1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Taiwan
    Posts
    74
    Answers
    1
    Vote Rating
    0
    cwtuan is an unknown quantity at this point

      0  

    Default Unanswered: Apply decodeURIComponent() for every AJAX response

    Unanswered: Apply decodeURIComponent() for every AJAX response


    Hi,
    For some reason, we have to encode Chinese characters in unicode at server side.
    But when loading a grid, I have to decode all of them again. An Example is shown below.
    PHP Code:
    columns : [  {
            
    dataIndex 'name',
            
    renderer : function(value) {
                return 
    decodeURIComponent(value);
            }
        },{
            
    dataIndex 'address',
            
    renderer : function(value) {
                return 
    decodeURIComponent(value);
            }
        }

    Is it possible to apply decodeURIComponent() for every AJAX response by default so that I don't have to write decodeURIComponent() for every grid column?

    Many thanks!
    Tony

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    Try to apply decoding at model definition by using field convert().

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    Taiwan
    Posts
    74
    Answers
    1
    Vote Rating
    0
    cwtuan is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by vietits View Post
    Try to apply decoding at model definition by using field convert().
    Hi, vietits
    Thanks for your reply!
    This method still needs to implement a converter for each model field.
    It would be better if we can apply decodeURIComponent() for all Ext.Ajax's response so that we don't have to do the dirty job.
    Thanks!

  4. #4
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    If so, you can listen for 'requestcomplete' event from Ext.Ajax:
    Code:
    Ext.Ajax.on('requestcomplete', function(connection, response, options){
        // your code here
    });

Thread Participants: 1

Tags for this Thread

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..."