I tried using the findNodesByText to find a string contained in a node. To my great surprise it only search an exact match?
[I'm a node]
var nodes = this.treeIDMap.igTree( "findNodesByText", "I'm a" );// -> Found nothing
var nodes = this.treeIDMap.igTree( "findNodesByText", "I'm a node" );// -> Found the node
var nodes = this.treeIDMap.igTree( "findNodesByText", "node" );// -> Found nothing
Why would that be? So figuring this is only an exact match I'm trying to code a function to do what I need.
------------Here is one way to do it I guess ---------
var foundNodes = new Array(); filter = filter.toLowerCase(); findInObject = function( obj, prop, val )//go as deep as posible and find a match { if ( obj !== null && obj.hasOwnProperty( prop ) && obj[prop].toLowerCase().indexOf(val) > -1 ) { return obj; } else { for ( var s in obj ) { if ( obj.hasOwnProperty( s ) && typeof obj[s] == 'object' && obj[s] !== null ) { var result = findInObject( obj[s], prop, val ); if ( result !== null ) { return result; } } } } return null; } for ( var i = 0; i < this.treeData.length; i++ )//use the internal copy of the data to do the search and only modify the live { if ( findInObject( this.treeData[i], "ITEM", filter ) ) foundNodes.push( this.treeData[i] )//does the node have a match in it anywhere? } this.treeIDMap.igTree( { dataSource: foundNodes } ); this.treeIDMap.igTree( "dataBind" );
still would like it faster.
Hi seang,
It's great that you bring this up. I have been thinking about improving this functionality for a while. I will create a customer case for you and our developer support would log an issue which I can use to rework the functionality. My intention has been to make the search case-insensitive or to add a flag to make it case-sensitive if required. Is this what you have in mind? Its performance can be improved as well.
Thanks you for using the Infragistics forums!
yes case sensitive flag along with indexof searching or some other forum of text in text search. Thx for the effort, I'd like so see how much fast it would be compared to my method.
Hi again seang,
I have implemented the functionality in the igTree. The findNodesByText and findImmediateNodesByText methods now match nodes that contain the given strings, not only exact matches. The methods are still case sensitive, however if you would like to make them case insensitive you can modify the :contains jQuery selector to be case insensitive as described in this article: http://css-tricks.com/snippets/jquery/make-jquery-contains-case-insensitive/
Let me know if you have any questions.
please help me with the upgrade here, evidently I didnt do it right. where do I need to go to download the latest?
Hello Seang,
The fix is going to be included in the upcoming service release. We will update you as soon as the service release is out including this fix.
To download the current service release for IgniteUI from our website, please follow these instructions:
1) Go to My Keys and Downloads page via the following link, you may be asked to log in using Infragistics member profile's user name and password:
https://ko.infragistics.com/my-account/keys-and-downloads/
2) Click on the "NetAdvantage" tab. This will show all of your registered license keys for NetAdvantage.
3) Click on the license key for the product and version for which you would like to download a service release. This will bring up all available public downloads for this product and version.
4) In the "Service Releases" section, click on the link for the appropriate version of NetAdvantage.
If your license key is not listed on the My Keys and Downloads page in step 2, then your key has not been registered to your member profile. To register your license key, please go to the Product Registration page, via the following link:
<http://devcenter.infragistics.com/Protected/ProductRegistration.Aspx>
Once your license key is registered, it should appear in the My Keys and Downloads page, thus allowing you to download service releases for that version of NetAdvantage.
If you are unable to register your license key for some reason, such as that it is already registered to another user, please contact our Registrations department at the following email address: registrations@infragistics.com
Your welcome, I'm just not built that way. Feedback is a must imo.
Thanks for the feedback! Usually people write us back only if the things don't work as they expected them to :)
the fix works well.
I use nuget for updates via the command prompt but i'd like to download the entire package and management it myself. Does nuget have a repository that I can download from the net? I just dont use it enough.
Hi Seang,
The fix would be available on NuGet with the next service release (we now have trial packages and free igGrid packages available on NuGet and we update them every service release). The next SR is scheduled to be the last week of June.
I hope this helps!