1. #1
    Ext JS Premium Member
    Join Date
    Apr 2008
    Location
    Oslo
    Posts
    64
    Vote Rating
    0
    mikhailt is on a distinguished road

      0  

    Default Ext.Button vs <input type="submit" name>. Need POST variable

    Ext.Button vs <input type="submit" name>. Need POST variable


    I need an Ext.Button equivalent to the following HTML

    Code:
    <input type="submit" name="button1" value="buttonOne">
    This HTML-based button submits POST variable named "button1" with a value "buttonOne".
    How to do this with Ext.Button?

    The problem is that Ext.Button has no 'name' property and does not submit a POST variable.

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Any reason why you couldn't put it in there?

    Code:
    var myBtn = new Ext.Button({
    ..//
       name : "myName',
    
    
    });

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2008
    Location
    Oslo
    Posts
    64
    Vote Rating
    0
    mikhailt is on a distinguished road

      0  

    Default


    Quote Originally Posted by jgarcia@tdg-i.com View Post
    Any reason why you couldn't put it in there?

    Code:
    var myBtn = new Ext.Button({
    ..//
       name : "myName',
    
    
    });
    The only reason is that this does NOT submit 'name' as POST variable. It's useless.

    With HTML-button <input type='submit' name='myname'>
    'myname' will be submitted as POST.

    I need the same for Ext.Button.


    My situation: I have many buttons in a form. And I want to differ between submitting through different buttons. The easiest way to do this is to send a POST variable with pressing a button.

  4. #4
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    add an additional param to the request when the button is pressed. or add a hidden field to the form.

  5. #5
    Ext JS Premium Member
    Join Date
    Apr 2008
    Location
    Oslo
    Posts
    64
    Vote Rating
    0
    mikhailt is on a distinguished road

      0  

    Default


    Quote Originally Posted by devnull View Post
    add an additional param to the request when the button is pressed.
    Right. The question is how to do this?
    Is there any tutorials available about button-click POST requests actions?

  6. #6
    Sencha User radustefan's Avatar
    Join Date
    May 2008
    Posts
    43
    Vote Rating
    0
    radustefan is on a distinguished road

      0  

    Default Send which button was pressed on SUBMIT

    Send which button was pressed on SUBMIT


    PHP Code:


    var btnSubmit = new Ext.form.Hidden({id:'Submit'name:'Submit'value:''})
    myDialog.addbtnSubmit );
        
    function 
    HandleSubmitbtn )
    {
        
    btnSubmit.setValuebtn.name );
            
    myDialog.getForm().getEl().dom.submit();


  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    34
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Try

    Code:
    Ext.SubmitButton = Ext.extend(Ext.Button, {
        template: new Ext.Template(
    		'<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>',
    		'<td class="x-btn-left"><i>&amp;#160;</i></td><td class="x-btn-center"><input type="submit" class="x-btn-text" name="{1}" value="{0}></td><td class="x-btn-right"><i>&amp;#160;</i></td>',
    		"</tr></tbody></table>"),
    	
    	onRender:   function(ct, position){
            var btn, targs = [this.text || ' ', this.name];
            if(position){
                btn = this.template.insertBefore(position, targs, true);
            }else{
                btn = this.template.append(ct, targs, true);
            }
            var btnEl = btn.child("input:first");
            btnEl.on('focus', this.onFocus, this);
            btnEl.on('blur', this.onBlur, this);
    
            this.initButtonEl(btn, btnEl);
            btn.un(this.clickEvent, this.onClick, this);
            Ext.ButtonToggleMgr.register(this);
        }
    });

  8. #8
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    34
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    The ampersand 160 things are supposed to be HTML entities ampesrand#160; to put a non breaking space in there, but the forum software doesn't like them.

  9. #9
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    34
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Oh, you'll also need

    Code:
    .x-btn input {
        border: 0px none;
        background: transparent none repeat scroll 0 0;
        color: #333333;
    }

  10. #10
    Ext JS Premium Member
    Join Date
    Apr 2008
    Location
    Oslo
    Posts
    64
    Vote Rating
    0
    mikhailt is on a distinguished road

      0  

    Default


    Animal, Well, after many tests, I could not get this to work. This is not button, this is input field, and text is editable there. But no click event works on this field. It does not submit the form.

    But I solved the problem by posting an addition variable through a hide input field when pressing button.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar