Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Prasad on Mar 14, 2008 08:15
open dhtmlx forum
not able to call beforInit method

Hello

This is my xml file, from where i am loading data in dhtmlxgrid.

<?xml version='1.0' encoding='iso-8859-1'?>
<rows>
<head>
<beforeInit>
<call command="setSkin"><param>Hi</param></call>
</beforeInit>
<column width="92" type="ed">A</column>
<column width="92" type="ed">A</column>
<column width="92" type="ed">A</column>
<column width="92" type="ed">A</column>
</head>
<row id="1">
<cell>a</cell>
<cell>b</cell>
<cell>c</cell>
<cell>d</cell>
</row>
<row id="2">
<cell>a</cell>
<cell>b</cell>
<cell>c</cell>
<cell>d</cell>
</row>
<row id="3">
<cell>a</cell>
<cell>b</cell>
<cell>c</cell>
<cell>d</cell>
</row>
<row id="4">
<cell>a</cell>
<cell>b</cell>
<cell>c</cell>
<cell>d</cell>
</row>
</rows>


All things going fine except beforeInit method.
I have setSkin method in the head section of jsp file.

function setSkin(hi){
     alert(hi);
         //mygrid.setSkin("light");
     }

I am not able to call this method, whats going wrong here.

I have also tried for afterInit method, that also not getting called.

Thanks
Answer posted by Support on Mar 14, 2008 10:18
The methods called from beforeInit|afterInit sections - are methods of the grid, not the external functions
if you need to call custom code it can be done in next way

<call command="my_setSkin"><param>Hi</param></call>
....
mygrid.my_setSkin=function(hi){
     alert(hi);
         //mygrid.setSkin("light");
   }