how to clear or empty datagrid after saving data

6k views Asked by At

i already try

    $('#dg').datagrid('reload');    

in the description it's describe "reload the current page data" but it didn't work

first i have page like this

http://www.indojpg.com/images/994Untitled.jpg

after i add some data it becomes like this

http://www.indojpg.com/images/431Untitled2.jpg

and then after i save the data the field should became empty again like first picture

how can i do this?

anyone can help me?

thank you

3

There are 3 answers

3
Vignesh Subramanian On

You can clear/empty the contents by using .html('');

So $('#dg').html(''); will work in your case for clearing the datagrid

0
xngiser On

If only you want clear or empty datagrid, You can try this:

 $('#dg').datagrid('loadData',[]);
0
sisyphus On

you can try this:

$('#dg').treegrid('loadData', {"total":0,"rows":[]});