"Jqgrid" trigger Select all not effective?

Source: Internet
Author: User
<pre name= "Code" class= "JavaScript" >$ ("#gridId"). Trigger ("Jqgridselectall");//Select all rows, and no response after the call
$ ("# Gridid "). Trigger (" Reloadgrid ");//reload data, call success

The Jqgridselectall trigger event is listed in Jqgrid's official documentation, but we use $ ("#gridId"). Trigger ("Jqgridselectall") trigger without any effect, I'm following the definition of the Reloadgrid trigger event.

. bind (' Reloadgrid ', function (e,opts) {
	...
}

But in the Jqgrid source code did not find jqgridselectall similar definition, so using JS trigger Jqgridselectall event has no effect, by modifying the Jqgrid source we can achieve jqgridselectall all-in-select events, $.fn.jqgrid = function (PIN) {} method populate (); ts.p.hiddengrid=false; Add the following code after

$ (TS). bind (' Jqgridselectall ', function (e,checkflag) {
	if (e.istrigger===2) {
		return;
	}
	$ (' #cb_ ' +ts.id). attr (' checked ', (checkflag===false));
      $ ("#cb_" +ts.id). Trigger ("click");
      $ (' #cb_ ' +ts.id). attr (' Checked ',! ( Checkflag===false);
});

Select all:

$ ("#gridId"). Trigger ("Jqgridselectall", true);
Cancel Select all:
$ ("#gridId"). Trigger ("Jqgridselectall", false);

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.