Easyui selection and all-in-choice code and method use

Source: Internet
Author: User

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

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.