Results 1 to 2 of 2

Thread: Change a cls at the run time in Ext JS 4.1.3

  1. #1

    Default Change a cls at the run time in Ext JS 4.1.3


    I have a requirement that a component should look like a combo box when it has more than one values and like a textfield when it has only one value.

    Instead of changing the component. I am choosing to just change the cls of that component that will make it look like a combo box or a textfield at the run time depending on the no of items in a combobox.
    To do that I am using the following
    comboBox.removeCls('comboBoxWithNoImg'); comboBox.addCls('comboBoxWithImg');
    But it is not working. When I inspect it at this point,it shows the changed cls in the watch (debugger) but not on the UI. Also, it seems that it is not getting refreshed or something.
    I also tried the following :
    comboBox.cls = 'comboBoxWithImg';
    comboBox.initialCls = 'comboBoxWithImg';
    comboBox.listConfig.cls = 'comboBoxWithImg';
    comboBox.initialConfig.cls= 'comboBoxWithImg';
    comboBox.fieldCls= 'comboBoxWithImg';

    But its not changing on the UI.
    Please help, I have put in a lot of time on this issue...
    Thanks in advance.

  2. #2
    Sencha User
    Join Date
    Jul 2011


    This is not Ext JS, but GXT section of forum.

Similar Threads

  1. Change a cls at the run time in Ext JS 4.1.3
    By Prachi Sinha in forum Ext: Q&A
    Replies: 1
    Last Post: 26 Oct 2015, 5:02 AM
  2. Time picker change color on setValue or change
    By ExDev in forum Ext 5: Q&A
    Replies: 1
    Last Post: 15 Jul 2015, 6:23 AM
  3. Replies: 1
    Last Post: 14 Feb 2013, 9:23 PM
  4. Change form in the run time
    By sj_tt6 in forum Ext: Q&A
    Replies: 4
    Last Post: 18 May 2012, 6:29 AM
  5. How to change uiProvider of TreeNode run time?
    By livinglegends in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 18 Nov 2010, 6:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts