Since upgrading to version 4.20.1, when you enter a keyword search in the DataGrid, it no longer highlights the matched string in the table rows. This used to work in older releases.
Working Example: https://design.infor.com/code/ids-enterprise/4.14.0/demo/components/datagrid/example-paging-client-side
Non-working Example: https://design.infor.com/code/ids-enterprise/latest/demo/components/datagrid/example-paging-client-side
Hint: sohoxi.js keywordSearch method on the DataGrid looks like the problem...
if (!this.settings.paging) {
this.highlightSearchRows(term);
}
We've actually documented this as a feature in our Product Guides across multiple tables, so I'd like the functionality re-instated.
Can you explain the hint more is it the fact it says if (!this.settings.paging) ? I'll address this in the current sprint, this was unintended.
I just had a look in the DataGrid's keywordSearch method to see what was happening and the code snipet I provided is there at the bottom of the method, which looks to me that keyword highlighting was deliberately turned off for tables where paging is set to true (as in the example, and in most of our tables).
OK i will have a look tried to look at the blame there https://github.com/infor-design/enterprise/blame/a806d2acbac9ba3a82b8f9e723a95bfb685aec0d/src/components/datagrid/datagrid.js#L6485 but thats been there 2 years.
(notegithub doesnt love that files blame so sometimes have to reload the unicorn)
OK, FYI as a test I removed the "paging: true" from the Datagrid settings object of one of our tables and the highighting started working again. Maybe the behaviour or default for that setting has changed?
OK, yes will sort it out. Not sure why it shouldnt work with paging except perhaps if its just serverside paging as you dont have the data all there and your doing that filter serverside so initially my guess is this should be ok for client side paging but not serverside paging. (so change this logic and add a regression test)
Thanks. It is also client side paging that is the problem (the examples I linked above are client side). Not tried server side as we only have one table in our product that uses it.
This is resolved in the linked PR will move to test once approved and merged.
http://master-enterprise.demo.design.infor.com/components/datagrid/example-paging-client-side
@tmcconechy is it expected that the highlighting removes when changing data grid page or sorting?
Ideally it could kept that information. So lets make a new issue for that as that never worked.
Alright @tmcconechy , will create separate issue for that. This one passed QA in all browsers, moving to Done.
Surely, for client side paging at least, if I've filtered the table data, then the table should contain only the matching results of the filter text, whether on a single page, or over multiple pages, sorting or paging through the filtered result rows should not reset the filter or change the highlighting. Only if I clear the filter or reload the table data some how should the highlighting be removed.
OK lets fail this then. I do agree since the search field is showing the search term, that filtering should probably work once paging or sorting.
@brianjuan changed my mind and failed this to add sorting and filtering support for client side paging + keyword filtering
Search filtering remains when changing page or sorting, it's just the highlighting that gets removed. But yeah I think highlighting should still remain as well.
Ok then definitely failed issue as that was the whole point of the fix 馃槥
I'll take another look 馃憤
http://master-enterprise.demo.design.infor.com/components/datagrid/example-paging-client-side
Passed QA in all browsers, highlighting works as expected and now remains when sorting and changing page.