PDA

View Full Version : DataView implementation



columbus30
15 Mar 2011, 3:36 AM
I am implementing the dataview.The code is as following :
DataView:


new Ext.DataView({
region:'center',
height:200,
store: crewStore,
tpl: tpl,
multiSelect: true,
singleSelect: false,
itemId: 'dataView',
itemSelector: 'div.thumb-wrap',
overClass: 'x-view-over'
})

Store:


var crewStore = new Ext.data.JsonStore({
storeId: 'crewStore',
idIndex: 0,
fields: [
'displayText',
],
data: this.msg
});
function fnOpMsg(){
Ext.Ajax.request({
url: 'messages.mvc',
params: {
ajaxFx: 'getMessages'
},
success: function(resp) {
var responseStr = Ext.decode(resp.responseText);
this.bannerMsg=responseStr.data;
new Ext.Window({
width:600,
height:450,
modal:true,
items:[dataPanel]
}).show();
}
});

}



The template is :


var tpl = '<tpl for="."><div id="{displayText}" style="width: 96%; display: block; float: left; clear: both; border: 1px solid #333333; height: auto; margin:10px 10px 0 10px;background-color:#444;font-color:#fff; "><img src="1299750057_Money.png" align="left" style="margin: 0px 5px 5px 0px; "/><a><font size ="3"color="white">{displayText}</font></a></div></tpl>';
the data coming as response is :
"data":{"currentPage":0,"searchResult":[{"checkState":false,"displayText":"<p>bshabdhsab<\/p>"}]

I am not getting any error but it is not showing anything in DataView.With HardCoded data working fine. Is there problem with template?
Please help.