The first thing to say is, onclick= "javascript: here can only write JS code, can not write a method name. ", followed by onclick=" The method name written here must exist in the line of this page JS, if it is introduced in the JS file method He will not recognize, will tell you did not find the XX method "
Next is the method of Easyui:
//Select All$ ("#mAllSelect"). Click (function () { $("#dgShowData"). DataGrid ("Checkall")); }); //Inverse Selection$ ("#mUnAllSelect"). Click (function () { varPagerow = $ ("#dgShowData"). DataGrid ("GetRows") varSelecrow = $ ("#dgShowData"). DataGrid ("Getselections") varPagerowsize =pagerow.length; varSelecrowsize =selecrow.length; //If the selected data is not available, the default is select all if(Selecrow.length = = 0) { $("#dgShowData"). DataGrid ("Checkall")); } for(vari=0;i<pagerowsize;i++){ varTemparray =NewArray (); //facilitates page data, and compares the selected data. for(varj=0;j<selecrowsize;j++){ //If the selected data is found, it becomes unchecked. Otherwise, it becomes selected. if(pagerow[i]==Selecrow[j]) { $("#dgShowData"). DataGrid ("Uncheckrow"), i) Break; }Else{ $("#dgShowData"). DataGrid ("Checkrow"), I)} } } }); //all do not choose$ ("#mClearSelect"). Click (function () { $("#dgShowData"). DataGrid ("Uncheckall")); });
Easyui selection and all-in-choice code and method use