开发者

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:

  1. set bserverside to false
  2. call fnAddData()
  3. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜