igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Feature request - rowID is included in lastSearchInfo.matchInfoCache.

Open tkiryu opened this issue 8 years ago • 2 comments

Scenario what I want

I want to select rows that contain a searched text after searching using findNext or findPrev.

Problem

Firstly, In order to select rows, I need to pass rowIDs into selectRows method, but I can only get row index from lastSearchInfo.matchInfoCache.

Secondly, it's difficult to get rowID with the clue of the row index in lastSearchInfo.matchInfoCache. Because the row index is not the one of datasource, but the one of dataview(which means filtered and sorted data). So I have to get dataview, then.

Finally, getting dataview is a little bother(I've submitted a feature requrest #1432 ).

Expected result

The best way for me to achieve my scenario is rowID is included in lastSearchInfo.matchInfoCache. If so, I could effortlessly get rowId from lastSearchInfo.matchInfoCache and pass it to selectRows.

I'd appreciate your consideration.

tkiryu avatar Jun 01 '18 10:06 tkiryu

When you have the visible row index from matchInfoCatch, then you can use the igxGrid public method getRowByIndex() to get the row. Then each row has public rowID property and you can use it to pass it to the selectRows() method.

Lipata avatar Jul 24 '18 15:07 Lipata

@Lipata , thank you for your suggestion. getRowByIndex() helps me achieve that. But, unfortunately, getRowByIndex() only works for visible rows. I cannot get rows that are not rendered in DOM.

By the way, I found that item property was added as a child of matchInfoCache when the following change was committed.

https://github.com/IgniteUI/igniteui-angular/commit/c0371e52d427dc4a6d3f62d98aaa01eead53c2a4#diff-ec3680553ab8c932743edefc8e3019fcR2184

The item is a row data so that now I can easily get its rowID from it. If item property is going to be a stable API, there is no problem to close this issue.

Best regards,

tkiryu avatar Jul 27 '18 12:07 tkiryu