Search instead of filtering (Essential JS 1)

Is it possible to only search within the treegrid.
It looks like that the search is also filtering the records in the treegrid.

I have configured the treegrid with the following search setting.
toolbarSettings: { showToolbar: true, toolbarItems: [ ej.TreeGrid.ToolbarItems.Search ], },

I see the searchbar in the treegrid toolbar, and i can write some searchtext inside. When i finish the input the records will be filtered with the given text.
But, i only would like to search for the next available record where the text was found.
Is it possible to only highlight the next found place instead of filtering?

Regards
Mike

3 Replies 1 reply marked as answer

MS Monisha Sivanthilingam Syncfusion Team April 13, 2021 10:41 AM UTC

Hi Mike, 
 
Thank you for contacting Syncfusion support. 
 
We have analyzed your query and would like to confirm whether we have understood your requirement correctly. So far, we have understood that the rows that match the search criteria should be selected or the cells to be highlighted, instead of show only those records in view. Have we gotten it correctly? 
 
Please contact us if you require any further assistance. 
 
Regards, 
Monisha. 
 



DE Developer April 13, 2021 11:02 AM UTC

Yes, you understand it correct. I only need some highlighting of the text or the selection of the rows where the search text was found.
I don't need the filtering mechanism in this search environment.

Regards
Mike


MS Monisha Sivanthilingam Syncfusion Team April 14, 2021 01:42 PM UTC

Hi Mike, 
  
Thank you for providing the additional information. 
  
We have made use of the searching requestType in actionBegin, refresh requestType in actionComplete and queryCellInfo events to achieve your requirement. The following code snippets demonstrate the solution. 
  
          actionBegin: function(args) { 
              if(args.requestType == "searching" && args.keyValue != "") { 
                key = args.model.searchSettings.key; 
                args.cancel = true; 
                var treeObject = $("#TreeGridContainer").data("ejTreeGrid");   
                treeObject.clearFilter("taskName"); 
              } 
            }, 
            actionComplete: function(args) { 
              if(args.requestType == "refresh") { 
                $("#TreeGridContainer").ejTreeGrid("option", "selectedRowIndex", 4); 
              } 
            }, 
            queryCellInfo: function (args) { 
              if(args.column.field == "taskName") { 
                if(args.cellValue == key){ 
                  selectedRecords.push(data.index); 
                } 
              } 
            } 
  
We have also prepared a sample for your reference. 
  
Please contact us if you require any further assistance. 
  
Regards, 
Monisha. 


Marked as answer
Loader.
Up arrow icon