EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 15, 2024, 03:19:20 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
out of control, the new added row is auto saved evenif the autoSave set false
Pages: [
1
]
« previous
next »
Print
Author
Topic: out of control, the new added row is auto saved evenif the autoSave set false (Read 4042 times)
Jeffrey AnnSheila
Newbie
Posts: 21
out of control, the new added row is auto saved evenif the autoSave set false
«
on:
May 29, 2016, 07:22:56 PM »
I am confused by a problem that is in an editable datagrid of edatagrid, after a new row is added, if you click the other row without clicking the save button in the toolbar instead, the ajax code still posts the editted data of the new added row with a param/value pair of "isNewRecord=true" .I have set the autoSave property to false, but that doesn't work. i don't know why. How to do it?
Logged
Jeffrey AnnSheila
Newbie
Posts: 21
Re: out of control, the new added row is auto saved evenif the autoSave set false
«
Reply #1 on:
May 31, 2016, 05:47:50 AM »
well,i try to work it out by jscode like below:
<div id="toolbarCase" hidden="hidden">
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:$('#dg').edatagrid('addRow')">new</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:$('#dg').edatagrid('destroyRow')">delete</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" plain="true"
onclick="save();">save</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="javascript:$('#dg').edatagrid('cancelRow')">cancel</a>
</div>
<table id="dgCase"></table>
<script type="text/javascript">
var conf = {
options:{
...
...
},
columns:[[
...
...]]
};
var commit=false;
var save=function(){
commit=true;
$('#dg').edatagrid('saveRow');
}
$(function(){
$('#dg').edatagrid({
...
...
autoSave:false,
onSave:function(index,row){
commit=false;
},
onBeforeSave:function(index){
if(commit==false){
return false;
}
}
}).datagrid('subgrid', conf);
</script>
«
Last Edit: May 31, 2016, 05:55:18 AM by Jeffrey AnnSheila
»
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...