Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by dan on Aug 11, 2008 20:32
open dhtmlx forum
Can't get row ID

Hi - I think I found a bug.

I have a row of checkbox for each row.
When I click on a checkbox, I expect an alert box that prints the ROW ID.

For some reason I am always getting a NULL for ROW id.

Could someone help me out as to why it's giving me a null?

You can look at the full solution at http://www.wright.edu/~combs.34/template/
and view the source code.

here's the snippet
---------------------------------------------------------------------------------
    function doOnCheck(rowId,cellInd,state){
        alert(rowId); // THIS ALWAYS RETURN NULL AND I DON'T KNOW WHY?
    }

    function initGrid() {
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("./images/");
    mygrid.setHeader("Fund,Symbol,All,SMS,Email,Calendar,RSS,IM,industry,sector,countries,markets,indices,fund_id");
    mygrid.setInitWidths("305,70,35,50,50,70,50,35,0,0,0,0,0,0")
    mygrid.setColAlign("left,center,center,center,center,center,center,center,left,left,left,left,left,left")
    mygrid.setColSorting("str,str,int,int,int,int,int,int,str,str,str,str,str,str")
    mygrid.setColTypes("ro,ro,ch,ch,ch,ch,ch,ch,ro,ro,ro,ro,ro,ro");
    mygrid.enableAutoHeigth(true);
mygrid.xml.top="funds";
mygrid.xml.row="./fund/fund_grid";
mygrid.setColumnIds("name,symbol,all,sms,email,calendar,rss,im,industry,sector,countries,markets,indices,fund_id");
mygrid.setColumnHidden(8,true);
mygrid.setColumnHidden(9,true);
    mygrid.setColumnHidden(10,true);
    mygrid.setColumnHidden(11,true);
    mygrid.setColumnHidden(12,true);
    mygrid.setColumnHidden(13,true);    
mygrid.attachEvent("onCheck",doOnCheck);
mygrid.init();
    mygrid.load("funds.xml", "xmlB");
}
Answer posted by Support on Aug 12, 2008 01:24
The code which you are using are correct
Are you sure that data which you loads from XML has some meningfull fund_grid@id values ?
Attachments (1)
Answer posted by Dan on Aug 12, 2008 01:29
Thanks - turns out I needed to put an ID attribute to the data xml being loaded.

thanks