I have a full screen layout. Cell(‘a’) has a grid in it with #connector_text_filter. I would like to dynamically update the cell(‘a’) header in the layout with the total number of rows in the grid using {#stat_count}. How could I pass the value of the stat_count with setText?
You can try the next approach: function doOnLoad(){
dhxLayout = new dhtmlXLayoutObject(document.body, "1C");
dhxGrid = dhxLayout.cells("a").attachGrid();
dhxGrid.setImagePath("../dhtmlxGrid/codebase/imgs/");
dhxLayout.cells("a").setText("<div id='tlb' style='width: 150px'></div>");
toolbar = new dhtmlXToolbarObject("tlb");
toolbar.setIconsPath("../___img/");
toolbar.addButton('printbtn', 0, '', 'print.ico');
toolbar.addText("text", 1, "");
dhxGrid.loadXML("../___xml/grid.xml", function(){
updateHeaderText("main text "+dhxGrid.getRowsNum())
});
dhxGrid.attachEvent("onKeyPress",function(code, ctrl, shift){
if (code=="46"){
dhxGrid.deleteSelectedRows();
updateHeaderText("main text "+dhxGrid.getRowsNum())
}
});
}
function updateHeaderText(text){
dhxLayout.cells("a").setText(text);
}