PDA

View Full Version : Loading Data from an arraystore and displaying it in a dataview



jasonrr
16 Sep 2010, 10:26 AM
Trying to do something which should be so simple, anybody had a problem displaying data from an array store?

Here is some test code in the hope somebody can assist, thanks in advance :)


Ext.setup({



onReady: function() {


var bslipview = new Ext.DataView({
store: new Ext.data.ArrayStore({
autoload:true,
idIndex:0,
fields: [ {name: 'description', type: 'string'} ],
data: [ [ "desct" ] ]
}),

tpl: new Ext.XTemplate(
'<h2>test1: {description}</h2>',
'<tpl for=".">',
'<h2>test2: {description}</h2>',
'</tpl>'
),

})

var betting_slip = new Ext.Panel({
fullscreen:true,
title:'test',
html:'<h2>Testy</h2>',
items:[bslipview],

});

;


}
});

evant
16 Sep 2010, 6:00 PM
Ext.setup({
onReady: function(){
var bslipview = new Ext.DataView({
store: new Ext.data.Store({
fields: [{
name: 'description',
type: 'string'
}],
data: [{
description: 'd1'
}, {
description: 'd2'
}]
}),
tpl: new Ext.XTemplate('<tpl for=".">', '<h2>test2: {description}</h2>', '</tpl>'),
});

var betting_slip = new Ext.Panel({
fullscreen: true,
title: 'test',
layout: 'fit',
items: [bslipview],
});
}
});