kimu
25 Mar 2007, 5:46 AM
I want to use Ext.DomHelper.append, but I'm not able to use it. This is my code:
rules = Ext.util.JSON.decode(o.responseText);
var ruleSelect = document.getElementById('validation-rule')
for(var i = 0, limit = rules.length; i < limit; i++){
opt = document.createElement('option');
opt.value = rules[i];
opt.innerHTML = rules[i];
ruleSelect.appendChild(opt);
}
Everything goes well with this code. If I try to do the same with Ext.DomHelper.append I obtain nothing. This is my code, what is wrong with this?:
rules = Ext.util.JSON.decode(o.responseText);
for(var i = 0, limit = rules.length; i < limit; i++){
Ext.DomHelper.append('validation-rule',{
tag:'option', value:rules[i], html:rules[i]
});
}
Thanks for your help
rules = Ext.util.JSON.decode(o.responseText);
var ruleSelect = document.getElementById('validation-rule')
for(var i = 0, limit = rules.length; i < limit; i++){
opt = document.createElement('option');
opt.value = rules[i];
opt.innerHTML = rules[i];
ruleSelect.appendChild(opt);
}
Everything goes well with this code. If I try to do the same with Ext.DomHelper.append I obtain nothing. This is my code, what is wrong with this?:
rules = Ext.util.JSON.decode(o.responseText);
for(var i = 0, limit = rules.length; i < limit; i++){
Ext.DomHelper.append('validation-rule',{
tag:'option', value:rules[i], html:rules[i]
});
}
Thanks for your help