Filter exact text search in Wijmo Grid

Posted by: sneha.nagaruru on 18 July 2021, 5:11 pm EST

  • Posted 18 July 2021, 5:11 pm EST

    Let’s say I have values in the columns

    Alfred

    Raymond

    Arnold

    Nathan

    Albert

    Natalia

    Currently the filter works like this

    for search key ‘al’ - results are key ‘al’ anywhere present in the value: Alfred, Albert, Natalia

    My requirement is when user prefixes ‘’ with search key like '[b]al[/b]’ - results should be the values only which starts with ‘al’: Alfred, Albert

    How can we do this?

    Thanks & Regards,

    Sneha Nagaruru

  • Posted 18 July 2021, 5:13 pm EST

    Used Angular with typescript

  • Posted 20 July 2021, 6:52 am EST

    Hi Sneha,

    You may refer to the following sample which demonstrates how we could override the default search functionality to implement custom search behavior:

    https://codesandbox.io/s/wijmo-angular-forked-yxlds?file=/src/app/app.component.ts

    Regards

  • Posted 23 July 2021, 5:41 am EST

    Hi Sharad,

    The sample works great but I need few customizations can you remove Hightlights for the matched text.

    Regards,

    Sneha

  • Posted 26 July 2021, 1:11 am EST

    Hi Sneha,

    You may set the empty string as cssMatch property of the FlexGridSearch to disable the highlight. Please refer to the following code snippet and the sample:

    <wj-flex-grid-search
      #gridSearch
      [grid]="grid"
      [cssMatch]="''"
      (initialized)="initSearch(gridSearch)"
    ></wj-flex-grid-search>
    

    https://codesandbox.io/s/wijmo-angular-forked-dy8xi?file=/src/app/app.component.html

    Regards

  • Posted 28 July 2021, 6:46 am EST

    Hi Sharad,

    Can we pass text to Gridsearch through code?

  • Posted 29 July 2021, 1:35 am EST

    You may use the text property to set the filter text by code.

    gridSearch.text = "s*";
    

    API reference:

    • text: https://www.grapecity.com/wijmo/api/classes/wijmo_grid_search.flexgridsearch.html#text

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels