-
17 Sep 2012 9:52 PM #1
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.
-
17 Sep 2012 10:08 PM #2
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.
-
17 Sep 2012 10:43 PM #3
This is my code that is displaying the grid
PHP Code:store: new Ext.data.Store({
root: 'results',
method: 'POST',
autoSave: false,
batch: true,
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({
encode: true,
writeAllFields: true,
batch: true
}),
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
baseParams: ahist_params
}),


Reply With Quote