I’m trying to capture when a different row is selected in the grid and I was using the event “onRowSelect” but that only worked for mouse click row changes and not keyboard row changes.
So I changed to “onRowIdChange”, but the event doesn’t appear to be firing for either mouse or keyboard row changes.
This occurs with “dhtmlxGrid v.2.5 Professional edition build 090904”
Could you look into this?
Thanks,
Terbeaux333
The event occurs when method changeRowId(…) is called. How do you change row id ?
I’ve gotten it to work using the event “onSelectStateChanged” using the following code:
myHoursGrid.attachEvent(“onSelectStateChanged”, “onHoursSelect”);
function onHoursSelect(sRowId) { alert(“Event Fired”); }
If I instead use “onRowIdChange”:
myHoursGrid.attachEvent(“onRowIdChange”, “onHoursSelect”);
function onHoursSelect(sOldRowId, sNewRowId) { alert(“Event Fired”); }
This does not work.
I’m initializing my table with the following code:
// Hours Grid
myHoursGrid = outerLayout.cells(“b”).attachGrid();
myHoursGrid.attachEvent(“onXLE”, applyProjectAttributes);
myHoursGrid.setImagePath(rHoursDir + “/Common/dhtmlx21/dhtmlxGrid/codebase/imgs/”);
myHoursGrid.setIconsPath(rHoursDir + “/images/”);
myHoursGrid.setSkin(“modern”);
myHoursGrid.setHeader(sGridHeader);
myHoursGrid.setColTypes(“tree,ro,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed”);
if (nWidth >= 1165) {
myHoursGrid.setInitWidths("*,75,55,55,55,55,55,55,55,55,55,55,55,55");
} else {
myHoursGrid.setInitWidths(“170,75,55,55,55,55,55,55,55,55,55,55,55,55”);
myHoursGrid.splitAt(2);
}
myHoursGrid.setColAlign(“left,left,right,right,right,right,right,right,right,right,right,right,right,right”);
myHoursGrid.setColSorting(“str,str,int,int,int,int,int,int,int,int,int,int,int,int”);
myHoursGrid.enableEditEvents(true,true,true);
myHoursGrid.attachEvent(“onEditCell”, “onHoursEdit”);
//myHoursGrid.attachEvent(“onRowIdChange”, “onHoursSelect”);
myHoursGrid.attachEvent(“onSelectStateChanged”, “onHoursSelect”);
myHoursGrid.enableTooltips(“true,true,false,false,false,false,false,false,false,false,false,false,false,false”);
myHoursGrid.setColumnColor(bkClr+","+bkClr);
myHoursGrid.init();
My table is then later loaded with treegrid data via XML using the load method.
In this situation, the event “onRowIdChange” is not working and never being called.
I can send more code, if you would like to debug further on your side…
Terbeaux333