1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    53
    Vote Rating
    0
    evs.saad is on a distinguished road

      0  

    Default Display html after sending result through JSON

    Display html after sending result through JSON


    Hi,
    I have a grid and I am sending the data through JSON to the grid. Now I want to display some html code after the code is displayed. I am sending my data like this echo '({"results":' . $jsonresult . '})'; The $jsonresult variable has the data that I want to display and it is displaying fine. Now I want to display some html after this variable.Is this possible.
    Thanks in advance.

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    HI!

    you may use renderer for your grid columns.
    check this sample:-

    Code:
    { 
        header: 'Name',
        dataIndex: 'Name',
        renderer :function(value, metaData, record, rowIndex, colIndex, store) { 
                 // do whatever you want here           
        } 
    },
    { header: 'Duration', dataIndex: 'Duration' }
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    53
    Vote Rating
    0
    evs.saad is on a distinguished road

      0  

    Default


    This is my code that is displaying the grid
    PHP Code:
    store: new Ext.data.Store({
            
    root'results',
            
    method'POST',
            
    autoSavefalse,
            
    batchtrue,
            
    proxy: new Ext.data.HttpProxy({
            
    api: {
                
    read'ajax/file.php?task=arg',
                
    create'ajax/file.php?task=arg',
                
    update'ajax/file.php?task=arg',
                
    destroy'ajax/file.php?task=arg'
            
    }
            }),
            
    writer: new Ext.data.JsonWriter({
                
    encodetrue,
                
    writeAllFieldstrue,
                
    batchtrue
            
    }),
            
    reader: new Ext.data.JsonReader({
                
    totalProperty'total',
                
    successProperty'success',
                
    idProperty'nr',
                
    root'results',
                
    fields: ['nr', {name'field1'type'date'dateFormat'Y-m-d'},'field2''field3''field4''field5''field6''field7', {name'field8'type'date'dateFormat'Y-m-d'},{name'field9'type'date'dateFormat'Y-m-d'}, 'field10','field11','field12','field13']
            }),
            
    // I want to load the html data after the grid has displayed the data how can I do this
            
    baseParamsahist_params
        
    }), 

Thread Participants: 1

Tags for this Thread