JQuery MiniUI development tutorial table control table Editing: Dialog Box editing (13th)

Source: Internet
Author: User


Reference example: CRUD: pop-up panel editing



I. Create a pop-up editing panel

<Div id = "editWindow" class = "mini-window" title = "Window" style = "width: pixel ;"
ShowModal = "true" allowResize = "true" allowDrag = "true"
>
<Div id = "editform" class = "form">
<Input class = "mini-hidden" name = "id"/>
<Table style = "width: 100%;">
<Tr>
<Td style = "width: 80px;"> employee account: </td>
<Td style = "width: 150px;"> <input name = "loginname" class = "mini-textbox"/> </td>
<Td style = "width: 80px;"> name: </td>
<Td style = "width: 150px;"> <input name = "name" class = "mini-textbox"/> </td>
<Td style = "width: 80px;"> salary: </td>
<Td style = "width: 150px;"> <input name = "salary" class = "mini-textbox"/> </td>
</Tr>
<Tr>
<Td> Gender: </td>
<Td> <input name = "gender" class = "mini-combobox" url = "mini_JSPath + '.. /.. /demo/data/genders.txt '"/> </td>
<Td> Age: </td>
<Td> <input name = "age" class = "mini-spinner" minValue = "0" maxValue = "200" value = "25"/> </td>
<Td> Date of Birth: </td>
<Td> <input name = "birthday" class = "mini-datepicker"/> </td>
</Tr>
<Tr>
<Td style = "text-align: right; padding-top: 5px; padding-right: 20px;" colspan = "6">
<A class = "Update_Button" href = "javascript: updateRow ()"> Update </a>
<A class = "Cancel_Button" href = "javascript: cancelRow ()"> Cancel </a>
</Td>
</Tr>

</Table>
</Div>
</Div>

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 ();

Related Article

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.