Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIHow can I customize filtering and delimited selections for DNNTextSuggest?How can I customize filtering and delimited selections for DNNTextSuggest?
Previous
 
Next
New Post
7/30/2007 12:05 AM
 

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/2/2007 12:08 AM
 

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 9:10 PM
 

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 6:27 PM
 

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 2:08 PM
 

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
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIHow can I customize filtering and delimited selections for DNNTextSuggest?How can I customize filtering and delimited selections for DNNTextSuggest?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out