Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jan 23, 2009 08:20
open dhtmlx forum
How can I use the javascript insdie the column tag

Hi

I am wondering is there anyway I can use the javascript insdie the column tag?

I tried to use the following ways, but none seems to be working:
<column width="100" type="ron" align="right" sort="int" format="javascript:getResStr('mask.currency');">
<column width="100" type="ron" align="right" sort="int" format="^javascript:getResStr('mask.currency')^_self"><fmt:message key="myplans.col.budget"/></column>

The reason I have to use the javascript here is my app initialize all formats according to user Locale in the javascript,

any help would be appreciated.
Answer posted by Support on Jan 23, 2009 09:34
You can't do it directly in XML, but can be done as

in XML
<rows>
<head>
   <column width="100" type="ron" align="right" sort="int" format="javascript:getResStr('mask.currency');"> ... any other init
   <afterInit><call command="init_format"><param>mask.currency</param><param>0</param></call>


in js code 

mygrid.init_format=function(a,b){
    mygrid.setNumberFormat(a,b);
}