| Page 1 of 1 | [ 5 posts ] |
|
Hello,
i have a rendered datatable instance with extended serverside paging and want to remove all existing rows and add new ones which is coming from server without rerendering my datatable instance. this ist my code to do this task: Code: this._dataTable.data.reset(); this._dataTable.data.add(data, { silent: true }); this._dataTable.syncUI(); and it works very fine and with a good performance, but i have a problem with the sorting after this lines. while the new datatable is created, it works well and quickly, but after paging it always takes longer and sorting is only possible in one direction and toggling the sort direction doesnt work anymore. anyone know why? Thank you and YUI3 framework is fantastic. Thank you for this. Last edited by AliRamezani on Tue Jun 19, 2012 12:02 am, edited 2 times in total. |
|
(Aside) You can just do this._dataTable.reset(data, { silent: true }).syncUI()
You're saying the sorting is slower after resetting the data? And I'm confused about your reference to both scrolling and pagination. Are you using a paginator module from the gallery, rolling your own, or something else? Are you using datatable-scroll with vertical scrolling as well? If you can link to more code in a gist, jsfiddle, or jsbin.com/3/ that would be helpful. |
|
Hello
here you can reproduce my problem: http://jsfiddle.net/Ali_Ramezani/qmvTe/11/ after switching the data you can not sort correctly. and how can I prevent the client-side sorting, without losing sorting behavior? CSS clickable columns, etc. thank you |
|
it seems to be working with the new release
http://yui.yahooapis.com/3.6.0pr3/build/yui/yui-min.js but how can i prevent the client-side sorting? see my last question. thank you. |
|
You need to prevent the 'sort' event, then call the server with the sort request info. In the handler for the server response, reset() the table's data with the response data, then set the sortBy attribute to the requested sort order.
Here's an example: http://jsfiddle.net/ls_n/PV3r4/ |
| Page 1 of 1 | [ 5 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group