Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 49

Thread: Ext.form.Button

  1. #11
    Sencha User JeffHowden's Avatar
    Join Date
    Mar 2007
    Location
    Forest Grove, OR
    Posts
    1,038
    Vote Rating
    1
      0  

    Default

    FWIW, the optimal layout of fields and buttons is for the left-edge of them to be aligned, not with the button being all the way to the left.
    Jeff Howden
    Ext JS - Support Team Volunteer
    jeff@extjs.com

  2. #12
    Sencha User feiichi's Avatar
    Join Date
    Jul 2007
    Posts
    39
    Vote Rating
    0
      0  

    Default

    Thank you so much for this extension!

  3. #13
    Ext User awahl's Avatar
    Join Date
    Feb 2008
    Location
    Germany, Montabaur
    Posts
    5
    Vote Rating
    0
      0  

    Exclamation Bug: Fieldset

    If you add a button to a fieldset, the button won't hide after collapsing the fieldset.

    Greetings

  4. #14
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    87
      0  

    Default

    Good job.


    Just an FYI, the component doesn't have to be so complex. you don't need to recreate the button. just extend field, change defaultAutoCreate to a simple div, then override the onRender function to include the button.

    it's that simple

  5. #15
    Sencha User
    Join Date
    Apr 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    If its so simple why not give a small code-example

  6. #16
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    Quote Originally Posted by wuschba View Post
    If its so simple why not give a small code-example
    isn't the full pseudocode blueprint sufficient

    you want the driveway + garage + porsche as well?

  7. #17
    Sencha User
    Join Date
    Apr 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    No porsche, but a small moped would be fine...

    It's just that the pseudo-code is clear, but all the details are not - for a beginner. For example: How do you include the button in onRender?

  8. #18
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    87
      1  

    Default

    Code:
    ButtonField = Ext.extend(Ext.form.Field,  {
    	defaultAutoCreate  : { 
    		tag: 'div' 
    	},
    	onRender: function (ct, position) {
                if(!this.el){
                    var cfg = this.getAutoCreate();
                    if(!cfg.name){
                        cfg.name = this.name || this.id;
                    }
                    if(this.inputType){
                        cfg.type = this.inputType;   
    		}
                    this.el = ct.createChild(cfg, position);
                }
    
    		this.button =  	new Ext.Button({
    			renderTo : this.el,
    			text     : this.text,
    			iconCls  : this.iconCls || null,
    			handler  : this.handler || Ext.emptyFn,
    			scope    : this.scope   || this
    		})
    	},
    	getValue : Ext.emptyFn,
    	setValue : Ext.emptyFn
    });

  9. #19
    Sencha User
    Join Date
    Apr 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    Well, I think I got the Prosche anyway... Thanks a lot, it works and helps me very much!

  10. #20
    Sencha User
    Join Date
    Apr 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    I included your solution in my AutoTableFormLayout: http://extjs.com/forum/showthread.php?t=41535

Page 2 of 5 FirstFirst 1234 ... LastLast

Posting Permissions

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