In the row editing mode of the DataGrid in easyui, locate a specific editor and add an event to it.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.