Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 4th Oct 2011, 01:30
gtr_ommar gtr_ommar is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 18
Default 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; 4th Oct 2011 at 01:53..
Reply With Quote
  #2  
Old 21st Nov 2011, 06:58
curiousgally curiousgally is offline
Registered Developer
 
Join Date: Mar 2011
Posts: 165
Default

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.
Reply With Quote
  #3  
Old 21st Nov 2011, 14:38
gtr_ommar gtr_ommar is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 18
Default

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();
Reply With Quote
  #4  
Old 20th May 2012, 22:42
dementiev dementiev is offline
Registered Developer
 
Join Date: May 2012
Posts: 3
Default

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; 20th May 2012 at 22:51..
Reply With Quote
  #5  
Old 21st May 2012, 22:13
dementiev dementiev is offline
Registered Developer
 
Join Date: May 2012
Posts: 3
Default

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
ListGrid: clicking header's checkbox doesn't fire SelectionUpdatedEvent tnozaki Smart GWT Technical Q&A 2 16th May 2011 11:54
Listgrid having conflict when setting both checkbox select and grouping on it ashesl Smart GWT Technical Q&A 0 15th Feb 2011 12:22
Converting string values to boolean for checkbox in ListGrid tlas Smart GWT Technical Q&A 2 6th Sep 2010 04:52
Browser specific bugs? fernandomm Technical Q&A 6 18th Sep 2009 23:07

© 2010,2011 Isomorphic Software. All Rights Reserved