Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Sunchaser on Oct 15, 2008 00:30
open dhtmlx forum
dhtmlxGrid / Is it possible to put "active object" in the footer of the grid ?

Hi,

I'd like to know if it is possible to put something like a radio-button (containing a onclick action, atc) in a footer of a grid, created with "attachFooter(...)'.

I've tried something like:
"
grid.attachFooter("#cspan, <input type='radio' id='aId' value='aValue' onclick='javascript:doSomething()'>aText<br>");

"
for example...
Is there soemthing else particular to do ?

Thanks
Regards.
Answer posted on Oct 15, 2008 01:42
Actually you can use any HTML based content in footer|header of grid. The code which you have used contains valid HTML code, but colspan placed incorrectly, the valid one will be. 

grid.attachFooter("<input type='radio' id='aId' value='aValue' onclick='javascript:doSomething()'>aText,#cspan");

Answer posted by Sunchaser on Oct 15, 2008 03:27
Hi,

Thanks for your fast answer, it seems that I haven't understood correctly the use/syntax of this function, now it begins to work.
One more thing -> the function called by "onclick" event contains parameters, which means that there are ',' in "prototype" of the function; the result is that the ',' are interpreted as a new "column" in the footer.
Is there a particular solution, or should I have to change the way I call the function ?
Thanks,
Regards.
Answer posted by Support on Oct 15, 2008 04:49
>>Is there a particular solution, or should I have to change the way I call the function ?
You can use array instead of comma separated string
grid.attachFooter(["#cspan","<input type='radio' id='aId' value='aValue' onclick='javascript:doSomething()'>aText , b , c<br>"]);
Answer posted by Sunchaser on Oct 15, 2008 07:12
Hi,
Thanks again, the problem is solved by using the "["  "]" for the items of the footer.

Regards.