1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    5
    Vote Rating
    0
    RedWhale is on a distinguished road

      0  

    Default Answered: How to handling the RowEditing update button?

    Answered: How to handling the RowEditing update button?


    Hi, I can speak a little english.
    I have a question.

    I want to handling RowEditing component "Update" button.
    if i click the "Update" button, then "proxy" params set, pass my server. i want it.

    My model proxy type "ajax" set, but why "rest" pass my server?

    plz help me.......


    PHP Code:
        ‚Äč/** my model.. */
    Ext.define('WFM.model.ContentModel', {
            
    extend'Ext.data.Model',
            
    proxy: {
                
    type'ajax',
                
    api: {
                    
    read'ContentAction',
                    
    create'ContentAction?mode=create',
                    
    update'ContentAction?mode=update',
                    
    destroy'ContentAction?mode=remove'
                
    },
                
    reader: {
                    
    type'json'
                    
    //root: 'users'
                
    },
                
    writer: { 
                    
    type'json'
                
    }
            },
            
    fields: [
                {
    name'name'type'string'},
                {
    name'memo'type'string'},
                {
    name'date'type'string'},
                {
    name'type'type'string'},
                {
    name'size'type'string'},
                {
    name'owner'type'string'}
            ]
            
        }); 
    1.jpg2.jpg

  2. You will need to create a custom writer to perform this. Something like:

    This example will pass the fields as params:

    Code:
    writer: {
        type: 'json',
        writeRecords:function(request, data){ 
            Ext.apply(data[0],request.params);
            request.jsonData = Ext.urlEncode(data[0]);
            return request;
        }          
    }
    Regards,
    Scott

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,154
    Vote Rating
    475
    Answers
    685
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You will need to create a custom writer to perform this. Something like:

    This example will pass the fields as params:

    Code:
    writer: {
        type: 'json',
        writeRecords:function(request, data){ 
            Ext.apply(data[0],request.params);
            request.jsonData = Ext.urlEncode(data[0]);
            return request;
        }          
    }
    Regards,
    Scott

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    5
    Vote Rating
    0
    RedWhale is on a distinguished road

      0  

    Default


    Thank you, Scott !!!!!!
    very nice !

    It's my solution !
    Code:
    			writer: {
    			    type: 'json',
    			    writeRecords:function(request, data){
    			        request.params = data[0];
    			        //console.log(request);
    			        return request;
    			    }          
    			}


    Quote Originally Posted by scottmartin View Post
    You will need to create a custom writer to perform this. Something like:

    This example will pass the fields as params:

    Code:
    writer: {
        type: 'json',
        writeRecords:function(request, data){ 
            Ext.apply(data[0],request.params);
            request.jsonData = Ext.urlEncode(data[0]);
            return request;
        }          
    }
    Regards,
    Scott

Thread Participants: 1