First define the edit button in the tbar of the grid:
Js code
Redefine form:
Js code
Js code
//--Define the editing window
if(!xjjlEditWindow)
{
xjjlEditWindow = new Ext.Window({
el: 'edit_win', //The front end places the current js file The div name in the page is
title: 'Edit Record',
width: 650,
height: 360,
closable: false,
closeAction: 'hide',
resizable : false,
items: xjjlEditForm //Load the edited form in the window
});
}
xjjlEditWindow.show(Ext.get('editDataButton'));//Show the edit window
//[Note] First xjjlEditWindow.show(); and then xjjlEditForm.getForm().loadRecord(currrecordRecord); can solve the problem that after the previous page loading is completed, the data cannot be loaded when the [Edit] button is clicked for the first time. It’s a question of form.
xjjlEditForm.getForm().loadRecord(record);
//The key is to fill the form with the record in the currently selected grid
}