Sometimes the value of an edit box needs to be changed according to the value of another edit box during row editing. You can find a specific editor and add events to it when you enable editing.
// Bind the event. The index is the current row.
VaREditors = $ ('# stafflogdetailgrid'). DataGrid ('geteditor', index );
Console.info (editors [5]);
VaRSfgzeditor = editors [5];
Sfgzeditor.tar get. BIND ('change ',Function(){
Console.info ("111 ");
Console.info(sfgzeditor.tar get. Val ());
});
The above edit type is: 'validatebox', as shown below;
Editor :{
Type: 'validatebox ',
Options :{
Required:True
}
}
The change event is bound, that is, when the cell content changes (no focus is required, as long as the content changes );
Of course, you can also bind another time: for example, "Blur": when the focus is lost, this requirement also exists. For example, after a cell is edited, at the same time, the content of some other cells also changes;
BIND is the awareness of binding, that is, the function of binding events;
Change, blur, and bindare all in edit(object).tar get; lele.info (editors [5]); you can view them in the Web Test tool;
There are also many events available for use
If the type is 'validatebox', you have already tested it. Yes. However, if the type is 'combobox', it seems that neither change nor blur events can be triggered normally; however, I can see lele.info (editors [5]);
The output target property value is:
|
Object [input. ComboBox-F] |
|
This is a ComboBox object; you can directly assign events to it; so the code is as follows:
// Bind events
VaREditors = $ ('# stafflogdetailgrid'). DataGrid ('geteditor', lastindex );
Console.info (editors [3]);
VaRSfgzeditor = editors [3];
VaRSfgzcobobox = sfgzeditor.tar get;
Console.info (sfgzcobobox );
Sfgzcobobox. ComboBox ({
Onchange:Function(N, O ){
Console.info ("111 ");
}
});
In this way, you can bind the edit event of Type ComboBox;
Http://blog.csdn.net/d7011800/article/details/8692635
In the row editing mode of the DataGrid in easyui, locate a specific editor and add an event to it.