0

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?

1
  • 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. Commented Feb 10, 2012 at 20:00

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Jovan I tried as mentioned in article, however new record added is not displayed unless I do a manual refresh by refreshing browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.