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 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”);

}

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 ?

1218530548.zip (84.9 KB)

Thanks - turns out I needed to put an ID attribute to the data xml being loaded.

thanks