EasyUI Forum
April 28, 2024, 01:32:32 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: clear all  (Read 8794 times)
john17
Newbie
*
Posts: 17


View Profile Email
« on: July 23, 2014, 11:14:16 PM »

hi guys,

how can I clear all the value when I click the add new row in datagrid every values in form and clear datagrid also?
Am having a trouble clearing the rows in datagrid here is my code

Code:
function newUser(){
           
            $('#dlg').dialog('open').dialog({
                title: 'New Vet',
                width: 1344,
                height: 635,
                closed: false,
                cache: false,
                modal: true,
                resizable: true
            });
           
            $('#fm').form('clear');
            $('#dg2').datagrid('reload');
           
            url1 = 'save-vet.html';
}

thank you very much
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: July 24, 2014, 01:27:46 AM »

Call 'clear' method to clear the form values.
Code:
$('#fm').form('clear');

No 'clear' method exists in datagrid, but you can call 'loadData' method with empty data to clear the datagrid.
Code:
$('#dg').datagrid('loadData', []);
Logged
john17
Newbie
*
Posts: 17


View Profile Email
« Reply #2 on: July 24, 2014, 10:07:44 PM »

thanks for this jarry I appreciate it Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!