Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jorge Arzuaga on Feb 19, 2009 15:11
open dhtmlx forum
Grid dhtmlXGridFromTable

I can do it the next:, but don`t work the example originally have "dhtmlXGridObject" but i need loading from html table...! IS possible?

<script>

mygrid = new dhtmlXGridFromTable('gridbox');
mygrid.init();
mygrid.loadXML("grid.xml", function(){
mygrid.attachHeader("#rspan,<div id='title_flt'></div>,<div id='author_flt'></div>,#rspan,#rspan,#rspan,#rspan,#rspan");
//set title filter field
document.getElementById("title_flt").appendChild(document.getElementById("title_flt_box").childNodes[0]);
document.getElementById("title_flt").appendChild(document.getElementById("title_flt_box1").childNodes[0]);
                
//set author fiter field
document.getElementById("author_flt").appendChild(document.getElementById("author_flt_box").childNodes[0]);
});

</script>

<div style="display:none">
    <div id="title_flt_box"><input name="a1" type="text"><input type="100%" style="border:1px solid gray;" onClick="(arguments[0]||window.event).cancelBubble=true;" onKeyUp="filterBy()"></div>
<div id="title_flt_box1"><input type="100%" style="border:1px solid gray;" onClick="(arguments[0]||window.event).cancelBubble=true;" onKeyUp="filterBy()"></div>
    <div id="author_flt_box"><select style="width:100%" onclick="(arguments[0]||window.event).cancelBubble=true;" onChange="filterBy()"></select></div>
</div>
Answer posted by Support on Feb 20, 2009 05:12
What is the purpose of next command? Are you loading part of data from HTML and part from XML?
      mygrid.loadXML("grid.xml", function(){

>>mygrid = new dhtmlXGridFromTable('gridbox');
>>mygrid.init();
more safe syntax for this command is 
     mygrid = dhtmlXGridFromTable('gridbox');
and you need not init command while loading from HTML

>>mygrid.attachHeader("#rspan,<div id='title_flt'>
can be used with grids, which created from XML, so the command itself is correct