How to add a row dynamically when using server-side processing?
I am using datatables with server-side processing turned on.
开发者_StackOverflow社区There are instances where persistence in database is done asynchronously, but I do get the event on server when something will be added and need to show that on the client. In that case, I want to add a row on client and increment the count.
The way I implemented is by following these steps:
- set bserverside to false
- call
fnAddData()
- set bserverside to true
This way row gets added on the client but since client only had current page - the total number of records become (page size + 1) instead of (previous total count + 1). I tried changing settings._iRecordsTotal
but it doesnt help.
Can you please help or provide me with any other approach?
There is a third party plugin for adding new records into the JQuery DataTable http://jquery-datatables-editable.googlecode.com/svn/trunk/index.html.
You can see example in the http://jquery-datatables-editable.googlecode.com/svn/trunk/addingrecords.html and documentation on the http://code.google.com/p/jquery-datatables-editable/wiki/AddingNewRecords
精彩评论