Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  How can I customize filtering and delimited selections for DNNTextSuggest?
Previous Previous
 
Next Next
New Post 7/29/2007 9:05 PM
User is offline David A-W
16 posts
10th Ranked


How can I customize filtering and delimited selections for DNNTextSuggest? 

I've got a DnnTextSuggest control with PopulateOnDemand implemented. I do a flexible string matching search on whatever is typed in (soundex, etc), so my stored procedure might return the following list if "br" is typed in:

  • Brian Jones
  • Phil Brandett
  • Rod Brown
  • Brad Bourke

But the control filters out items that don't start with 'br', so the users never get to see Phil or Rod above. 

Can anyone help me track down the code that performs this filtering?  I've sifted through the latest released DNNTextSuggest.vb and also dnntextsuggest.js but haven't been able to identify where it's done.

Secondly, if you don't want to allow a delimited list of selections, how can you prevent the delimiter showing up in the list after a node is clicked?

 
New Post 8/1/2007 9:08 PM
User is offline Jon Henning
1594 posts
www.codeendeavors.com
5th Ranked










Re: How can I customize filtering and delimited selections for DNNTextSuggest? 

The control only does a callback when it needs to.  If you have

  • aaa
  • aba
  • abb
  • aca

in your list, and you type a, you get all 4.  Now you type ab, it knows that it doesn't need to do a callback, as it has the surrounding results in the list.  Therefore your soundex logic will not fit very well here.

The control has a property to specify a delimiter.  simply specify an empty string.

 


 
New Post 8/2/2007 6:10 PM
User is offline David A-W
16 posts
10th Ranked


Re: How can I customize filtering and delimited selections for DNNTextSuggest? 

Fair enough, but for my particular needs the user might mistype the name, or just plug in a firstname or surname, etc.

So I need the flexible matching.

For reference to anyone else that needs it, I modified line 422 withing dnn.controls.dnntextsuggest.js from
if (this.formatText(oTSNode.text).indexOf(this.formatText(this.getText())) == 0 && oCont.childNodes.length < this.maxRows)

To

if ((oCont.childNodes.length < this.maxRows) && ((this.callBack != '') || this.formatText(oTSNode.text).indexOf(this.formatText(this.getText())) == 0))

In this way, original left matching will be preserved if standard databinding - otherwise I'll show whatever my callback returns each time unfiltered.

With regards to specifying an empty string as a delimiter, this works in IE but doesn't seem to in Firefox  (2.0.0.5, including on your sample site).  Firefox interprets the empty string as a character with code 65533 for some reason, which comes up on screen as a question mark.  I added the following hack after line 65 to fix this:

this.delimiter = dnn.dom.getAttr(o, 'del', '');

 // HACK: Firefox seems to pickup a dodgy delimiter character when none has actually been specified 

 if (this.delimiter.charCodeAt(0) == 65533) this.delimiter = '';

 
New Post 4/7/2008 3:27 PM
User is offline Data Springs Inc.
95 posts
www.datasprings.com/default.aspx?tabid=367
10th Ranked


Re: How can I customize filtering and delimited selections for DNNTextSuggest? 

Hi guys... This hack for the FireFox fix and the 65533 delimiter works great. Thanks a lot for posting this. It would be nice if this was included within the file without having to change the file for retrofits for each DNN upgrade. Just my two cents... :)

 

-Chad

 

 
New Post 4/9/2008 11:08 AM
User is offline Data Springs Inc.
95 posts
www.datasprings.com/default.aspx?tabid=367
10th Ranked


Re: How can I customize filtering and delimited selections for DNNTextSuggest? 

David,

Thanks again for posting these changes, they are very helpful. Would you happen to know what the javascript would need to be changed to in order for the searches to always just check the beginning of new works. For example typing in Jones would return:

 

Bob Jones

Chad SamJones

Nathan EricJones

 

In the code you posted, but we are wanting it to just show Bob Jones etc... Any thoughts would be appreciated.

 

-Chad

 

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  How can I customize filtering and delimited selections for DNNTextSuggest?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


UK - DotNetNuke providers
UK providers of DNN module development and skin package design. Oxford Information Labs provides cost-effective solutions for businesses and organisations specialising in Skin design and bespoke module development.
www.oxil.co.uk
TronixSoft
Hosting for local businesses that want more from their websites.
www.TronixSoft.com
The Forerunner Network
The Forerunner Network consists of a group of Dynamic Website & Interactive Membership Portal hosting services that are managed by Forerunner Communications. Our services span a wide range of markets and enable individuals, organizations and businesses to build and manage dynamic, interactive portals and websites.
The Forerunner Network

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP