We have a button and on click of button we run action . First action is query two different models from history object. 2nd action is Adopt rows in model and 3rd is open a pop up. Pop up has a table and that uses the model where we adopted rows.
Every thing works fine except
1. sorting the model does not work. It appends other model after the first one.
2. If we do the UI sorting on table and user click on arrow, data from one of the model is lost.
Page 1 / 1
Anshul,
I think we may have already answered your question when working with you directly, but I wanted to go ahead and post an answer here in case anyone else encounters this issue.
If I understand the situation correctly, you’re adopting one model’s rows (call it Model into another model (call it Model A). The problems are:
- When Model B’s rows are adopted into Model A, Model B’s rows are simply appended at the end, rather than being sorted along with Model A’s rows based on Model A’s sort order.
- If you sort Model A’s table, rows from Model B are lost.
Here’s why you’re encountering the issues mentioned:
Both of these issues come down to the the difference between server-side and client-side operations. A model’s default sort order AND table sort are both server-side operations, while the “Adopt Rows” functionality is a client-side operation. Model sort order is only applied on model query, which is why rows are only sorted when Model A is first queries. Table sorting actually re-queries the table’s original model (Model A) from the server and refreshes the table based on these results, which is why Model B’s rows are dropped out of the table.
I hope this helps.
Emily
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.