Frog Frog Recommended: All check boxes in DataGrid
We often choose a set of data in DataGrid, then operate, if you want to do all, if you need a full-elected function, if you use this all-in-one server-side event to let the DataGrid check box all select box, Will go back to the server again, we can write a JS function to simplify this step.
In fact, DataGrid generates an HTML table in the client, the ID attribute of the table is the ID of the DataGrid. This ID can be obtained with the clientID, and your all-in-button can also add an onclick property in the background encoding to let him perform you. JS code, for example, you declare a DataGrid1 DataGrid, then put a check box in a template column, then declare a checkbox1 outside to select the check box inside DataGrid1, the syntax is as follows.
Checkbox1.attributes.add ("Onclick", "" "" " DG1.CLIENTID ");
Below is I have made a presentation with HTML code.
Function CHK (CHK, ID) {
VAR OEVENT = Document.All (ID);
Var chks = OEvent.GETELEMENTSBYTAGNAME ("Input");
For (VAR i = 0; i { IF (chks [i] .type == "checkbox") Chks [i] .checked = chk.checked; } } // -> script> hEAD>
td> | td> | td>
TR> |
td> | td> | td>
TR> |
td> | td> | td>
TR> TABLE> body> html>
转载请注明原文地址:https://www.9cbs.com/read-40377.html New Post(0)
|