1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    131
    Answers
    1
    Vote Rating
    1
    shaoen01 is on a distinguished road

      0  

    Default Unanswered: Add some Parameters to Form on Postback

    Unanswered: Add some Parameters to Form on Postback


    Hi,

    I am currently using Form Fileupload example to upload a file and my server side will handle the backend processing. I would like to add a few parameters on to postback like how i do in the store code below. I added two extra parameters: request and task. I would like to do the same for the file upload example, but i'm having no luck.

    Am i even able to do it this way similar to the store?

    Store Code:
    Code:
    statustypestore = Ext.create('Ext.data.Store', {
            model: 'StatusTypeModel',
            proxy: new Ext.data.HttpProxy({
                // load using script tags for cross domain, if the data in on the same domain as
                // this page, an HttpProxy would be better
                //type: 'jsonp',
                type: 'ajax',
                url: 'database.php',
                extraParams: {
                    task: 'ListStatusType',
                    request: 'StatusType'
                },
                reader: {
                    root: 'results',
                    totalProperty: 'total'
                },
                // sends single sort as multi parameter
                simpleSortMode: true
            })
        });
    Fileupload inside the buttons:
    Code:
    buttons: [{
            text: 'Save',
            handler: function(){
                var form = this.up('form').getForm();
                if(form.isValid()){
                    form.submit({
                        url: 'add_file.php',
                        extraParams: {
                            task: 'ListStatusType',
                            request: 'StatusType'
                        },
                        waitMsg: 'Uploading your file...',
                        success: function(fp, o) {
                            msg('Success', 'Processed file "' + o.result.file + '" on the server');
                        }
                    });
                }
            }
        }]

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    131
    Answers
    1
    Vote Rating
    1
    shaoen01 is on a distinguished road

      0  

    Default


    It seems that form is using "params" instead of "extraParams". I am sharing my code below for those who might be facing same issue as myself:<br>
    Code:
    <br><pre class="bbcode_code" style="height:252px;">buttons: [{
            text: 'Save',
            handler: function(){
                var form = this.up('form').getForm();
                if(form.isValid()){
                    form.submit({
                        url: 'add_file.php',
                        <strong>params: {
                            task: 'ListStatusType',
                            request: 'StatusType'
                        },</strong>
                        waitMsg: 'Uploading your file...',
                        success: function(fp, o) {
                            msg('Success', 'Processed file "' + o.result.file + '" on the server');
                        }
                    });
                }
            }
        }]

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