Closed samsam321 closed 6 years ago
as your data source is asynchronous, I think you should use st-safe-src
. Difficult to say though, can you please provide a running example ? thanks
Thanks for reply ^^
@lorenzofox3 From the test, I am sure that the data (listViewResultSet.items) is updated. But the control pagination have not triggered , because of the watching conditional have not changed , it is identical , because of the data is identical.
here is the example: https://plnkr.co/edit/KW9rfn0mag1WbEgnzOiG?p=preview
press load button to load the identical data again you will see the first page show 5 item, but the setting is 2 item per page. when you press > , the pagination watch triggered
So yes you need to tell smart-table your data source will change by using st-safe-src attribure st-table binding value only becomes a variable placeholder for your template (use by the repeater) https://plnkr.co/edit/scXrtsvc1wbguPtTZR11?p=preview
I have a button to load the data to data array
and assigned to table
when I press the load button again, the data same data reloaded to listViewResultSet.items
then found out the watch of tableState().pagination won't trigger because of the data and pagination is no change.
resulted that , the table show all items in the first page instead of 5 until i press next or > the tableState().pagination changed will trigger the watch , and back to normal again.
Would you help to advice how to reset the tableState().pagination ? thanks
Regards