Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Prabhu on May 11, 2008 23:35
open dhtmlx forum
#master_checkbox

Hi,

I'm using #master_checkbox and "Ch" for the each row.

The problem is :

When i click(check) the master checkbox ...all the rows are selected(checked).....But when i uncheck any one row from the grid,master checkbox should uncheck...but its not unchecking the mastercheck box.Could you please help me in this issue...Please tell me how to uncheck the master checkbox when any row is unchecked from the grid.Advance thanks for your help!
Answer posted by Support on May 12, 2008 02:26
Such functionality can be implemented by using next code snippet

    grid.attachEvent("onCheckbox",function(row,ind,state){
          if (!state){   //unchecked
                // this code locates the HTML object of master checkbox, it expects that checkbox sits in second row of header
                var master=this.hdr.rows[2].cells[ind].getElementsByTagName("INPUT")[0];
                master.checked=false;
           }
          return true;
    })