ExtJs dataview refresh problem

[code]Ext.getCmp(dataview id).getStore().load({params:{}});
or
Ext.getCmp(dataview id).getStore().reload();[/code]

By using this code your dataview automatically be refreshed.

[html]NOTE: The response only come in the pure json format[/html]

If you will use this in PHP for fetching the data for
dataview you must declare $json_data[‘templateItems’][]= $row;
in case of no result found. Otherwise your data view not working correctly.

[code]
$result= mysql_query($query);
$json_data[‘templateItems’] = array();
while($row= mysql_fetch_assoc($result)){
$json_data[‘templateItems’][]= $row;
}
echo json_encode($json_data);exit;[/code]

[html]Data view code[/html]

[code]new Ext.DataView({

store: new Ext.data.JsonStore({
url: ‘connect.php’,
baseParams: {moduleId:moduleId,action:’doAction’,activity:’getTemplateCats’},
autoLoad:false,
root: ‘templatecats’,
fields: [‘templatecat_name’,’id’]
}),
tpl: new Ext.XTemplate(
”,

<div>{templatecat_name}</div>
‘,

),
listeners : {
click : function(dataView,index,node,e) {
var record = dataView.getRecord(node);
var cat_name =record.get("templatecat_name");
var cat_id =record.get(‘id’);

Ext.getCmp(‘cat_id_temp_s’).setValue(cat_id);
Ext.getCmp(‘newCardS’).getLayout().setActiveItem(1);
Ext.getCmp(‘s-templates-items’).getStore().load(
{params:{moduleId:moduleId,action:’doAction’,
cat_id:cat_id,templatelocation:’subjective’,activity:’getTemplates’}});
}
},
id:’s-templates’,
autoHeight:true,
multiSelect: true,
overClass:’x-view-over’,
itemSelector:’div.thumb-wrap’,
emptyText: ‘No templates to display’
})

[/code]