Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by h on Feb 11, 2009 06:27
open dhtmlx forum
dhtmlxGrid checkbox

Hello again:)

I want to build grid with checkbox column and put #master_checkbox in header. Data loaded correctly from xml, but checkboxes do not appere:(
What is wrong with my code?

-----> code -----

var mapChooseWin;
var mapUsersGrid;

creteMapChooseWin();

function creteMapChooseWin(){
    mapChooseWin = infoWins.createWindow('choose','0','0','600','250');
    mapChooseWin.setText('Выберите абонентов...');
    mapChooseWin.denyResize();
    mapChooseWin.centerOnScreen();
    mapChooseWin.button('stick').hide();
    mapChooseWin.button('minmax1').hide();
    mapChooseWin.button('minmax2').hide();
    mapChooseWin.button('park').hide();
    mapChooseWin.progressOn();
    mapUsersGrid = createMapUsersGrid();

}

function createMapUsersGrid() {
    var grd;
    grd = mapChooseWin.attachGrid();
    grd.setHeader("#master_checkbox,ID,ФИ,Рабочий,Мобильный,Домашний");
    grd.setInitWidths("60,40,*,90,90,90");
    grd.setColTypes("ch[0],ro,ro,ro,ro,ro");
    grd.setColAlign("center,center,center,center,center,center,");
    grd.enableResizing("false,false,false,false,false,false");
    grd.init();
    grd.loadXML("/xmlreq/showusers.php?type=chooser");
    return grd;
}


------> xml data ------
<?xml version="1.0" encoding="UTF-8" ?>
<rows>
<row id="1">
cell>1</cell>
<cell>Johnson John</cell>
<cell>1005</cell>
<cell>3265</cell>
<cell>1222455</cell>
</row>
<row id="2">
<cell>2</cell>
<cell>Marcson Marc</cell>
<cell>1001</cell>
<cell>3156</cell>
<cell>86418651</cell>
</row>
<row id="3">
<cell>4</cell>
<cell>Sheppard Jack</cell>
<cell>1011</cell>
<cell>3564</cell>
<cell>849531813</cell>
</row>
<row id="4">
<cell>5</cell>
<cell>Petrov Vasya</cell>
<cell>1023</cell>
<cell>4521</cell>
<cell>321554899</cell>
</row>
<row id="5">
cell>6</cell>
<cell>Vasin Petya</cell>
<cell>1065</cell>
<cell>3246</cell>
<cell>898443131</cell>
</row>
</rows>
Answer posted by h on Feb 11, 2009 06:49
?:)
Answer posted by dhxSupport on Feb 11, 2009 07:19
Your code looks correct. Please make sure that you attached dhtmlxgrid_filter.js file
Answer posted by h on Feb 11, 2009 22:23
Damn! :) Masterbox - mission comleted. Checkboxes in the grid - mission NOTcomleted. Anything else js files?
Answer posted by Alex (support) on Feb 12, 2009 02:17

Probably you have missed setImagePath method. It sets a path to grid images (grid checkboxes are images):

grid.setImagePath(path);