Reference example: CRUD: pop-up panel editing 1: Create a pop-up editing Panel & lt; divid & quot; editWindow & quot; class & quot; mini-window & quot; title & quot; window & quot; style & quot; width: pixel PX; & quot; showModal & quot; true & qu
Reference example: CRUD: pop-up panel editing
I. Create a pop-up editing panel
ShowModal = "true" allowResize = "true" allowDrag = "true"
>
Employee account: |
|
Name: |
|
Salary: |
|
Gender: |
|
Age: |
|
Date of birth: |
|
Update Cancel
|
2. Panel operations
Pop-up loading panel data:
Var editWindow = mini. get ("editWindow ");
EditWindow. show ();
Var form = new mini. Form ("# editform ");
Form. loading ();
$. Ajax ({
Url: "../data/DataService. aspx? Method = GetEmployee & id = "+ row. id,
Success: function (text ){
Var o = mini. decode (text );
Form. setData (o );
Form. unmask ();
},
Error: function (){
Alert ("form loading error ");
}
});
Save submit panel data:
Var form = new mini. Form ("# editform ");
Var o = form. getData ();
Grid. loading ("saving ......");
Var json = mini. encode ([o]);
$. Ajax ({
Url: "../data/DataService. aspx? Method = SaveEmployees ",
Data: {employees: json },
Success: function (text ){
Grid. reload ();
},
Error: function (jqXHR, textStatus, errorThrown ){
Alert (jqXHR. responseText );
}
});
EditWindow. hide ();