-
13 Dec 2011 6:50 AM #1
Unanswered: Load dataview
Unanswered: Load dataview
Hi,
Is there anyway to load a data view by selected record?
I've looked everywhere, but couldn't find any answers.Code:initComponent: function() { var dockedItems, items, list, listeners, self = this; list = new Ext.List({ scroll: false, title: 'My title', store: this.store.getAt(/* record index */), singleSelect: true, itemSelector: 'div.wrapper', id: 'myList', loading: true, itemTpl: self.myTemplate(), listeners: { itemtap: function(list, index) { //TODO handle request } } }); items = [list]; Ext.apply(this, { dockedItems: dockedItems, items: items }); app.views.View.superclass.initComponent.call(this); }
Thank you in advanceLast edited by 92Michel; 13 Dec 2011 at 6:53 AM. Reason: secured data
-
13 Dec 2011 7:31 AM #2
-
13 Dec 2011 10:25 PM #3
Do you want to display the dataview on the panel after selecting from the select field?
-
13 Dec 2011 11:56 PM #4
Load dataview
Load dataview
Thank you for your quick replies,
I've got a list with records. When I select a specific record, I create a panel overlay with a dataview in it. I want to load my selected record in the dataview of the panel overlay.
-
14 Dec 2011 12:31 AM #5
Here in your code on itemtap you can show a panel which you can keep floating so it acts as a overlay.In that panel you can write your dataview logic.
var accountPanel = new Ext.Panel({
floating: true,
modal: true,
centered: true,
width: 220,
height: 180,
styleHtmlContent: true,
scroll: 'vertical',
items: [dataViewPanel]
});
var dataViewPanel = new Ext.Panel({
items: [productsList]
});
var productsList = new Ext.DataView({
scroll:vertical,
store: new Ext.data.Store({
model: 'Account_Model',
proxy: {
type: 'ajax',
url : '//ur json file',
reader: {
type: 'json',
root: 'parent'
}
},
autoLoad : true
}),
tpl: new Ext.XTemplate(
//ur template
),
itemSelector: "div.item"
});
Ext.regModel('Account_Model', {
//ur model
});
I hope this helps you.


Reply With Quote