イージーdatagridセル編集時にイベントが別のセルに変更されました.
4294 ワード
1 //datagrid
2 $('#acc').datagrid({
3 columns : [ [
4 {
5 field : 'fee_lend',
6 title : ' A',
7 width : 100,
8 editor : "numberbox"
9 }, {
10 field : 'fee_loan',
11 title : ' B',
12 width : 100,
13 editor : "numberbox"
14 },
15 ] ]
16 })
17 //
18 onBeginEdit : function(rowIndex, rowData){
19 var editors = $('#acc').datagrid('getEditors', rowIndex);
20 var lendEditor = editors[0];
21 var loadEditor = editors[1];
22 //target DOM
23 lendEditor.target.numberbox({
24 onChange:function(newValue,oldValue){
25 if(newValue > 0){
26 loadEditor.target.numberbox('setValue', null);
27 }
28 }
29 });
30
31 loadEditor.target.numberbox({
32 onChange:function(newValue,oldValue){
33 if(newValue > 0){
34 lendEditor.target.numberbox('setValue', null);
35 }
36 }
37 });
38 },
転載先:https://www.cnblogs.com/linvan/p/6607465.html