EasyUI Forum
July 05, 2024, 07:02:09 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: edatagrid: saveRow after updateRow on: June 18, 2019, 05:33:38 AM
Hi I found the solution (maybe not the best one).

Code:
$('#dg').edatagrid('beginEdit',index);
var ed = $('#dg').datagrid('getEditor',{index:index,field:'status'});
ed.target.prop('checked','true');
$('#dg').edatagrid('endEdit',index);

2  General Category / EasyUI for jQuery / edatagrid: saveRow after updateRow on: June 13, 2019, 04:24:38 AM
Hi, I am using edatagrid. I have a table like this:
idnamecontentsstatus
. The status will be changed from code if I click a print button. My code is like this.

Code:
var row = $('#dg').edatagrid('getSelected');
var index = $('#dg').edatagrid('getRowIndex',row);
row.status = 'Yes';
$('#dg').edatagrid('updateRow',{index:index,row:row});
$('#dg').edatagrid('saveRow');
$('#dg').edatagrid('refreshRow',index);


But the data in the database doesn't change. I know how to post the changes through ajax. Is there a better way to do this automatically? Just like I clicked the row and changed the value? Thanks.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!