ExtJS Grid line Edit Plugin Event Trigger

Source: Internet
Author: User

Originally this number is to find a job (to record their own work during the code to brush the thought of the results, it is important to pretend to have a technical blog ...) ), but the sorting algorithm has not finished brushing to find a job, so the lazy disease continues to attack did not write. Now work, really do not understand anything, in order to record the problems encountered in the work, it must be picked up again.

Recent projects to use the ExtJS, because they do not understand, so I arranged a simple table add and remove the implementation of the change, encountered a lot of problems, slowly solve it, now say in a grid, when using the line edit plugin, click Save How to trigger the event.

How to set a listener on the view surface, trigger listening, and then on the controller page to process the listener, the process is as follows: For each class, what to trigger the listener, you can extjs the API documentation to find the class events, which events, which events can trigger monitoring. For example Ext.grid.plugin.RowEditing class, have Beforeedit, CancelEdit, edit, Validateedit four kinds of events, then listener can listen to these four kinds of events, Read the API documentation to see what events they listen to separately, and write the following code under the View page plug-in configuration:

Listeners: {            edit: {                fn: ' Wobuzhidao ',                scope: ' Controller '            }        }

Listeners monitors the edit event, its handler function is named Wobuzhidao, the scope of the controller, the controller code is as follows

function (editor, context, eopts) {        alert (context.record.get (' age '));    }

In this processing function, there are 3 parameters, from the View page listener of the edit pass, through the API documentation we can see the three parameters, and know what they represent. The above code implemented in the grid in the plugin plug-in, the line edit set a listener, when the edit save will trigger the edit event, through the context parameter of the. Record.get (' age ') gets the value of the edit row corresponding column.

ExtJS Grid line Edit Plugin Event Trigger

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.