Giving column a priority when using row level search

Giving column a priority when using row level search

masti13harshmasti13harsh Posts: 4Questions: 2Answers: 0

My table is as follows:
First Name | Last Name | Address | Priority
abc | mno | ghi | 2
def | mno | jkl | 1
mno | abc | def | 3

I already have a priority numeric column, through which I sort my data.
Now if I search for "mno", the result should first take priority as order then since I matched with the first column, that should be the second priority..
mno | abc | def | 3
def | mno | jkl | 1
abc | mno | ghi | 2

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    The ordering of the rows in the DataTable is entirely defined by the ordering condition that is applied to the data.

    There is currently no option to have the search information included in that I'm afraid.

    Allan

  • masti13harshmasti13harsh Posts: 4Questions: 2Answers: 0

    Is there any hook through which I can get the search result data and sort it manually?

  • kthorngrenkthorngren Posts: 21,301Questions: 26Answers: 4,946

    The search function filters the table display by removing the rows that don't match. Sounds like you want to display everything but move select rows to the top of the table.

    If thats the case then I would suggest looking at using a combination of filter() to get the desired rows and the solution described in Sorting with absolute positioned data.

    The rows returned from filter() would be updated with data to affect the absoluteOrder search.

    Kevin

This discussion has been closed.