i am adding new category object using ajax in the view layer, and Spring MVC. İnsert work great, but after that, i dont know how to refresh my datatable.(i know fnDraw but i need to populare the table again) how can i do this in a best way?
-
I'm not sure I understand the question. What's wrong with repopulating the table using fnDraw? You COULD just use the ajax callback to trigger some sort of more granular "insert" function for DataTables... or you could just redraw the whole thing.Greg Pettit– Greg Pettit2012-02-10 20:00:50 +00:00Commented Feb 10, 2012 at 20:00
1 Answer
Take a look at JQuery DataTables Editable plugin. This is add-on for the standard JQuery DataTables plugin that makes your life easier when you need to add records to datatable. All you need to do is to create form for adding records, one add button and servlet that handles create ajax request. This add-on will automatically add this row in the table and refresh it.
You can see live demo on http://jquery-datatables-editable.googlecode.com/svn/trunk/addingrecords.html and one tutorial about DataTables/Java integration in the article http://www.codeproject.com/Articles/193068/Adding-data-management-CRUD-functionalities-to-the
Jovan