PDA

View Full Version : checkboxgroup length



sunco
30 Dec 2009, 3:31 PM
I have a FormPanel with a checkboxgroup with 8 items. How can i obtain the length of that checkboxgroup (can be dynamic) and the values one by one ?

With "normal" JavaScript i can use:


number = document.form_name.checkboxgroup_name.length;

...

value = document.form_name.checkboxgroup_name[0].value;

...

if (document.form_name.checkboxgroup_name[0].checked == true) {

..

document.form_name.checkboxgroup_name[0].checked = true;

What about in ExtJs way ?

sunco
31 Dec 2009, 11:36 AM
Anybody ?

I already try with:



var f = Ext.getCmp("form_id").getForm();

alert(f.Checks_Name.length); // null or not an object

alert(f.items.Checks_Name.length); // null or not an object

f.items.each(function(x){
if (x.id == "checks_id") {
alert(x.length); // undefined
}
});

sunco
31 Dec 2009, 11:49 AM
Finally



f = Ext.getCmp("form_id").getForm().getEl().dom.checks_id;

alert(f.length);