1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    218
    Vote Rating
    0
    alien3d is on a distinguished road

      0  

    Default Restfull

    Restfull


    I thought like this.Ext should give exception on 'PUT' and 'DELETE' and and accept response from 'POST' OR 'GET' as PUT and delete.Firebug couldn't identify 'DELETE' and php also not support native $_PUT or $_DELETE.I testing using row editor + data api.When i testing for error , only create working on exception.No wonder it's work , i used $_POST .
    ** for normal data api it work only exception couldn't output because the response code = 0

    refer
    http://en.wikipedia.org/wiki/Represe...State_Transfer

  2. #2
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Unfortunately I have no idea what any of this means. Are you talking about using Ext.Direct on the server side?
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    218
    Vote Rating
    0
    alien3d is on a distinguished road

      0  

    Default


    PHP Code:
    var proxyTrxCode = new Ext.data.HttpProxy({
        
            
    successProperty'success',
            
    api: {
                
    read: {
                    
    url'lon_cat_sub_data_trx.php?method=read&leaf_uniqueId=' leaf_uniqueId,
                    
    method'GET',
                    
                    
    params: {
                        
    method'read'
                    
    }
                },
                
    create: {
                    
    url'lon_cat_sub_data_trx.php?method=create&leaf_uniqueId=' leaf_uniqueId,
                    
    method'POST',
                    
    params: {
                        
    method'save'
                    
    }
                },
                
    update: {
                    
    url'lon_cat_sub_data_trx.php?method=update&leaf_uniqueId=' leaf_uniqueId,
                    
    method'PUT',
                    
    params: {
                        
    method'save'
                    
    }
                },
                
    destroy: {
                    
    url'lon_cat_sub_data_trx.php?method=delete&leaf_uniqueId=' leaf_uniqueId,
                    
    method'DELETE',
                    
    params: {
                        
    method'delete'
                    
    }
                }
            }
        
        });


        
        var 
    cop_lon_cat_sub_trx_store = new Ext.data.JsonStore({
            
    autoDestroytrue,
            
    url'trx_data.php',
            
    remoteSorttrue,
            
    root'cop_lon_cat_sub_trx',
            
    id'cop_lon_cat_sub_trx_uniqueId',
            
    totalProperty'total',
            
    proxyproxyTrxCode,
            
    idProperty'cop_lon_cat_sub_trx_uniqueId',
            
    writerwriterTrxCode,
            
    restfulltrue,
            
    baseParams: {
                
    leaf_uniqueIdleaf_uniqueId
            
    },
            
    listeners: {
                
    exception: function(DataProxytypeactionoptionsresponsearg){
                    var 
    serverMessage Ext.util.JSON.decode(response.responseText);
                    if (
    serverMessage.success == 'false' || serverMessage.success1 == 'false') {
                        
    Ext.MessageBox.alert("Error"serverMessage.message);
                    }
                }
            },
            
    fields: [{
                
    name'cop_lon_cat_sub_trx_uniqueId'
            
    }, {
                
    name'cop_lon_cat_sub_trx_nme'
            
    }, {
                
    name'trx_acc_mod'
            
    }, {
                
    name'trx_uniqueId'
            
    }, {
                
    name'gl_chart_concat'
            
    }, {
                
    name'gl_chart_des'
            
    }, {
                
    name'gl_chart_acc'
            
    }, {
                
    name'trx_cde'
            
    }, {
                
    name'trx_des'
            
    }]
        }); 
    This is example what i do.
    If we put
    PHP Code:
    update: {
            
    url'lon_cat_sub_data_trx.php?method=update&leaf_uniqueId=' leaf_uniqueId,
                    
    method'POST',

    If i on purpose error my query and want to output sql statement error in message box.The listeners exception wouldn't catch it.The response status = undefined.The only way to output message in messagebox only to use the 'method:put' then the response.status=200 and message output.
    E.g image to output on error handling.


    Uploaded with ImageShack.us
    ** i will make basic example post/get/put/delete in extjs+roweditor+http proxy api + php + mysql for future other references.
    E.g output for restfull using extjs and php.and DELETE value didn't appear in firebug.Quite confuse on debugging.Only in google chrome you will see DELETE value.


    Uploaded with ImageShack.us

Similar Threads

  1. exception in restfull
    By alien3d in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 27 Jun 2010, 9:56 PM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi