After extjs checkboxselectionmodel is selected, the checkbox of the table header is cleared.

Source: Internet
Author: User

After extjs is all selected, click Delete and the All selected box is still selected. The all selected box should not be selected after deletion.

 

 

Solution:

Add the following methods to delete an event:

 
Function autocheckgridhead () {var hd_checker = ext. getcmp ("Grid-sysmsg "). getel (). select ('div. x-grid3-hd-checker '); var Hd = hd_checker.first (); // clear the checkbox if (HD. hasclass ('x-grid3-hd-checker-on ') {HD. removeclass ('x-grid3-hd-checker-on ');}}

Below is a section I saw on the InternetCodeFor more information, see.

Solution: // monitor whether the store data changes and perform other processing; pl_store.on ('datachanged', function () {var Hd = pl_grid.getel (). select ('div. x-grid3-hd-checker '); If (pl_grid.getselectionmodel (). getselections (). length! = Pagecount) {// if not all are selected, // clear the checkbox if (HD. hasclass ('x-grid3-hd-checker-on ') {HD. removeclass ('x-grid3-hd-checker-on '); // x-grid3-hd-checker-on} else {If (! HD. hasclass ('x-grid3-hd-checker-on ') {HD. addclass ('x-grid3-hd-checker-on '); // x-grid3-hd-checker-on}); this previously written implementation (the above Code) has a problem with pl_grid.getel (). select ('div. x-grid3-hd-checker '); find the wrong element, huh, may cause the grid header checkbox is not available; please refer to the following implementation: // automatically determines whether all checkbox functions autocheckgridhead () {var hd_checker = grid_taskquerypop.getel () are selected or not (). select ('div. x-grid3-hd-checker '); var Hd = hd_checker.first (); If (HD! = NULL) {If (grid_taskquerypop.getselectionmodel (). getselections (). length! = Grid_taskquerypop.getstore (). getcount () {// clear the checkbox if (HD. hasclass ('x-grid3-hd-checker-on ') {HD. removeclass ('x-grid3-hd-checker-on '); // x-grid3-hd-checker-on // grid_taskquerypop.getselectionmodel (). clearselections () ;}} else {If (grid_taskquerypop.getstore (). getcount () = 0) {// empty if no record exists; return;} HD. addclass ('x-grid3-hd-checker-on '); grid_taskquerypop.getselectionmodel (). selectall ();}}}

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.