EasyUI中datagrid的行编辑模式中,找到特定的Editor,并为其添加事件

有时候在行编辑的时候,一个编辑框的值要根据其它编辑框的值进行变化,那么可以通过在开启编辑时,找到特定的Editor,为其添加事件

function editrow(index) {    

if (rowedit == 0) {        

$('#ZCEditList').datagrid('beginEdit', index);        

rowedit = 1;

        var editors = $('#ZCEditList').datagrid('getEditors', index);            

  var TonsEditor = editors[3];        

var HorsepowerEditor = editors[4];           

var StandardEditor = editors[10];         

TonsEditor.target.bind('blur', function () {            

HorsepowerEditor.target.val('');            

var sum = TonsEditor.target.val() * 10;                    

  StandardEditor.target.val(sum);

        });        

    } }

原文地址:https://www.cnblogs.com/hanshuhe/p/2650817.html