some grid functions dont work in layout

some of the grid functions dont work when i use layout:

dhxGrid = dhxLayout.cells(“b”).attachGrid();
dhxGrid.setImagePath(“inc/codebase/imgs/”);
dhxGrid.loadXML(“inc/xml/patienten.php”);
dhxGrid.attachEvent(“doOnRowSelected”, patient_selected);

function patient_selected() { alert(“test”); }

in this case i dont get a alert when i click a row… (also dont get an error)

dhxGrid.attachHeader("#rspan,#connector_text_filter,#rspan,#rspan,#rspan");
dhxGrid.setHeader(" ,Name,Size,Type,Modified");

also dont work… how can i fix this?

dhxGrid.attachEvent(“doOnRowSelected”, patient_selected);

The correct event name is onRowSelect

dhxGrid.attachEvent(“onRowSelect”, patient_selected);

docs.dhtmlx.com/doku.php?id=dhtmlxgrid:events

dhxGrid.attachHeader("#rspan,#connector_text_filter,#rspan,#rspan,#rspan");
dhxGrid.setHeader(" ,Name,Size,Type,Modified");

Methods should be called before grid initialization:

dhxGrid = dhxLayout.cells(“b”).attachGrid();
dhxGrid.setHeader(" ,Name,Size,Type,Modified");
dhxGrid.attachHeader("#rspan,#connector_text_filter,#rspan,#rspan,#rspan");

dhxGrid.init();

You should choose either you configure grid in the xml or using grid API (setHeader, attachHeader,setColWidth, etc.)

Please check grid samples.

if got onrowselect working now… but
dhxGrid.attachHeader("#rspan,#connector_text_filter,#rspan,#rspan,#rspan");

still doesnt work… its before dhxGrid.init();

Here is the working demo:
dhtmlx.com/docs/products/dht … combo.html

The only deference is the you use “dhxLayout.cells(“b”).attachGrid()” instead of “new dhtmlXGridObject(…)” to create grid object.

i can see the text field, and it does sort, but when i enter something, it doesnt filter…
it works with a standard xml file, but not with this one:

header(“Content-type: text/xml”);
echo(’<?xml version="1.0" encoding="utf-8"?>’);

echo ‘’;
echo ‘’;
//echo ‘’;
//echo ‘xp’;
//echo ‘’;
//echo ’ ';
//echo ‘string value’;
//echo ‘’;
//echo ‘’;
//echo ‘img:[…/…/images/icons/vcard.png] Nummer’;
//echo ‘img:[…/…/images/icons/folder_user.png] Naam’;
//echo ‘img:[…/…/images/icons/cake.png] Geboorteplaats’;
//echo ‘img:[…/…/images/icons/house.png] Plaats’;
//echo ‘’;
//echo ‘%’;
//echo ‘’;
echo ‘’;

$sql = “SELECT * from patient WHERE PatNumNew > ‘0’”;
$res = mysql_query ($sql);

if($res){
while($row=mysql_fetch_array($res)){
//create xml tag for grid’s row
echo ("<row id=’".$row[‘PatNumNew’]."’>");
print("<![CDATA[ ]]>");
print("");
print("<![CDATA[ ".$row['AchterNaam']."]]>");
print("");
print("");
print("");
}
}else{
//error occurs
echo mysql_errno().": “.mysql_error().” at “.LINE.” line in “.FILE.” file
";
}

echo ‘’;

#connector_text_filter needs using connector. You don’t use it. Therefore, try to use simple filtering:
#text_filter

dhxGrid.attachHeader("#rspan,#text_filter,#rspan,#rspan,#rspan");

thnx, its working now…