Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Listgrid Checkbox Clicking Handler

    This is not a bug.

    I already make use the documentation and test severals methods such cellClick, rowClick, recordClick, and selectRecord.
    I can't find a way to handle an event when i select a record in a grid using selection appearance: 'checkbox'

    Question : is there any method/function will be invoked just after selecting a record using checkbox before it goes to selectionChanged()/selectionUpdated() ?

    This is because i wanted to handle the checkbox selection.

    Thanks.
    Last edited by gtr_ommar; 4 Oct 2011, 01:53.

    #2
    Hi,

    I don't think there is any such handler for the checkbox click event. If your checkbox column is going to be a at a fixed position, you can get the event using cellClickEvent which has the method getColNum() which can be used to write custom code when clicked on the checkbox.

    Hope this helps.

    Thanks.

    Comment


      #3
      yes you are right. but i forgot to mention it is for treegrid. not listgrid which i suspect to be the same.

      i did this test on http://www.smartclient.com/#_Grids_Interaction_Checkbox.Select
      and http://www.smartclient.com/#cascadingSelection

      this one is ok.
      Code:
      isc.ListGrid.create({
          ID: "countryList",
          width:500, height:224, alternateRecordStyles:true,
          data: [
              {
                  continent:"North America",
                  countryName:"United States",
                  countryCode:"US",
                  area:9631420,
                  population:298444215,
                  gdp:12360.0,
                  independence:new Date(1776,6,4),
                  government:"federal republic",
                  government_desc:2,
                  capital:"Washington, DC",
                  member_g8:true,
                  article:"http://en.wikipedia.org/wiki/United_states"
              }
          ],
          selectionAppearance:"checkbox",
          fields:[
              {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
              {name:"countryName", title:"Country"},
              {name:"capital", title:"Capital"},
              {name:"continent", title:"Continent"}
          ],
          cellClick: function(){        alert("inside cellClick()");    }
      });
      this one it wont alert
      Code:
      isc.TreeGrid.create({
          ID: "employeeTree",
          data: isc.Tree.create({
              modelType: "parent",
              nameProperty: "Name",
              idField: "EmployeeId",
              parentIdField: "ReportsTo",
              data: [
                  {EmployeeId:"4", ReportsTo:"1", Name:"Charles Madigen"},
                  {EmployeeId:"188", ReportsTo:"4", Name:"Rogine Leger"},
                  {EmployeeId:"189", ReportsTo:"4", Name:"Gene Porter"},
                  {EmployeeId:"265", ReportsTo:"189", Name:"Olivier Doucet"},
                  {EmployeeId:"264", ReportsTo:"189", Name:"Cheryl Pearson"}
              ]
          }),
      
          // customize appearance
          width: 500,
          height: 400,
          nodeIcon:"icons/16/person.png",
          folderIcon:"icons/16/person.png",
          showOpenIcons:false,
          showDropIcons:false,
          closedIconSuffix:"",
          selectionAppearance:"checkbox",
          showSelectedStyle:false,
          showPartialSelection:true,
          cascadeSelection:true,
          cellClick: function(){
              alert("inside cellClick()");
          }
      });
      
      employeeTree.getData().openAll();

      Comment


        #4
        Hi, guys. Were you able to resolve this issue? I approve that onCellClick doesn`t fire while clicking on checkbox in the treegrid record.
        cellClickEvent.getColNum() == 0 is at the cell that goes right after checkbox.
        onRecordClick(...) also isn`t called when checkbox in treegrid is clicked.
        Is there any way to handle checkbox clicking in the treegrid?

        Where should I create an issue/bug request?
        Regards? Dmitry.
        Last edited by dementiev; 20 May 2012, 22:51.

        Comment


          #5
          addSelectionChangedHandler on treegrid helped me to resolve the issue.
          The example is here: http://www.smartclient.com/smartgwt/showcase/#grid_interaction_checkboxselect

          Comment

          Working...
          X