Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Rudy on Apr 16, 2008 13:02
open dhtmlx forum
attachEvent method used in xml configuration

Hello:

It looks like, for my application, I will configure my grids using the xml api. Using the xml api, how would I describe an attachEvent method? So how would I translate this js api definition:

    grid.attachEvent("onXLS",function(){
     preXMLLoad(grid);
    });

to something using the xml api? Would it look something like this:

<afterInit>     
<call command="attachEvent">     
<param>grid</param>    
</call>    
</afterInit>

Thanks
Answer posted by Support on Apr 17, 2008 01:47
While configuring grid from xml , you can't set the exact event handler code, but you can attach any existing js function
For example if you have

function my_on_load(){
     preXMLLoad(grid);
};

You can use next code in XML


<afterInit>     
    <call command="attachEvent">     
        <param>onXLS</param>    
        <param>my_on_load</param>    
    </call>    
</afterInit>