Results 1 to 3 of 3

Thread: How to add id attribute to a div-EXTJS3

  1. #1

    Default How to add id attribute to a div-EXTJS3

    I have a component whose 'id' is auto-generated. I want to replace that id with my own for styling purposes. I'm unable to use class for styling as the class is used by bunch of other components.
    Code:
    Ext.query('.q-superdate-field')
    that results into:

    Code:
    <input type="text" size="16" autocomplete="off" id="ext-comp-1100" name="ext-comp-1100" class="x-form-text x-form-field q-superdate-field x-form-empty-field x-trigger-noedit" readonly="" style="width: 100px;">
    I want to change the width of the input field using id. Is there a way to replace exisiting 'Id' and create one of our own

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Rather than changing IDs, perhaps you could use the cls config.
    http://docs.sencha.com/extjs/3.4.0/#...tField-cfg-cls

  3. #3

    Default

    so I have condition depending on which i need to add the styling class. so tried this as per suggested:

    Code:
    this.superclass.constructor.call(this, Ext.apply({            mode: this.mode
                itemCls: this.mode == true ? 'required-datepicker' : '',
                cls: 'q-superdate-field'
    
            });
    for some reason the above condition seems to be false always and hence the class is not getting added or may im doing something wrong all together. any other suggestions that could work in this case?
    Thanks

Similar Threads

  1. How to using TreeGrid in Extjs3.2.1
    By anya in forum Ext 3.x: Help & Discussion
    Replies: 11
    Last Post: 18 Mar 2012, 11:15 PM
  2. ExtJS3 dead?
    By defcon1 in forum Ext 3.x: Bugs
    Replies: 1
    Last Post: 4 May 2011, 7:19 AM
  3. Replies: 0
    Last Post: 1 Nov 2009, 8:10 AM
  4. does "BasicForm" have any attribute like html Form "target" attribute
    By michoeal in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 25 Dec 2007, 3:05 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
  •