-
6 Aug 2011 1:53 PM #11
Any answer for ExtJS4 ??
-
7 Aug 2011 4:55 AM #12
possible solution
possible solution
I finally resolved to changing the HTML in the DOM directly, the only way I got it working was
But why is there no setLabel() method for a checkbox...? For any field in a form this should be a standard function..Code:chkboxfld.el.dom.firstChild.lastChild.innerHTML = "new label";
-
1 Sep 2011 7:18 AM #13
-
2 Sep 2011 4:24 AM #14
-
18 Oct 2011 5:38 AM #15
Re
Re
maybe this is better:
var ckb = this.query('checkboxfield')[0]
ckb.boxLabelEl.dom.childNodes[0].nodeValue
-
15 Nov 2011 2:13 AM #16
ExtJS 4
ExtJS 4
In ExtJS 4, this seems to work:
Code:checkbox.getEl().down('.x-form-cb-label').update(newText);
-
25 Jun 2012 11:13 PM #17
I think this would be currently the best solution in ExtJS 4:
But there is a problem with sizing. If the new text is wider than the old one, the label element will not be resized which leads to an ugly line break. What would be the right way to force recalculating the width? checkbox.doComponentLayout() respectively doLayout() or doComponentLayout() of the ownerCt does not work. Has anyone an idea?Code:checkbox.boxLabelEl.update(newLabelText);
Apart from that a method like setBoxLabel() would be really nice.
I've tested it with a radio field instead of a checkbox. Do they behave different (their box label logic doesn't inherit from a common class).
-
23 Jan 2013 5:51 AM #18
I am also facing the same issue.
I am looking to write generic utility to set the fieldLabel for all the control type like checkbox,radio,textbox, etc.
Can some one let me know how can I do that ?
For textbox - getfieldLabel and setFieldLabel() working fine.
Dipak
-
4 Mar 2013 6:56 AM #19
Use:
checkbox.el.down('.x-form-cb-label').update('Your box label');
-
8 May 2013 6:42 AM #20
Try with
Ext.get('idOfBoxEl').dom.innerHTML = 'NewLabel'
Regards
URL


Reply With Quote