soma13
1 Apr 2011, 1:29 AM
Hi All,
I would like to get a little help.
I want to use some javasctipt command in setTemplate() method because I need to convert my string values to a real filename:
ComboBox<Country> countryComboBox = new ComboBox<Country>();
countryComboBox.setStore(countryStore);
countryComboBox.setTemplate( getFlagTemplate("resources/images/flags") );
countryComboBox.setDisplayField("countryName");
...
[CODE]
[CODE]
private native String getFlagTemplate(String base)
/*-{
var flagImgName = {countryName}.toLowerCase();
return [
'<tpl for=".">',
'<div class="x-combo-list-item"><img width="16px" height="11px" src="' + base + flagImgName + '_small.png"></div>',
'</tpl>'
].join("");
}-*/;
Could you tell me how can I use {countryName}.toLowerCase() javascript method in getFlagTemplate() method?
thx!
I would like to get a little help.
I want to use some javasctipt command in setTemplate() method because I need to convert my string values to a real filename:
ComboBox<Country> countryComboBox = new ComboBox<Country>();
countryComboBox.setStore(countryStore);
countryComboBox.setTemplate( getFlagTemplate("resources/images/flags") );
countryComboBox.setDisplayField("countryName");
...
[CODE]
[CODE]
private native String getFlagTemplate(String base)
/*-{
var flagImgName = {countryName}.toLowerCase();
return [
'<tpl for=".">',
'<div class="x-combo-list-item"><img width="16px" height="11px" src="' + base + flagImgName + '_small.png"></div>',
'</tpl>'
].join("");
}-*/;
Could you tell me how can I use {countryName}.toLowerCase() javascript method in getFlagTemplate() method?
thx!