PDA

View Full Version : Dataview should only show one record



thomas.oberthanner
15 Oct 2010, 12:47 PM
hi,

as searching the web/this forum did not suceed, i would like to post this question:

i have got a store, a gridpanel displaying data from this store, everything fine - but i have no clue, how to display a dataview in a new panel, which only shows data from a single record of this store (imagine a panel showing details of the record).

what is the right approach to this?
i tried using a xtemplate, but obviously
<tpl for=".">...</tpl> won't work. is there a way to include the record id in a xtemplate (i could not find anything like that in the docs)

filtering the store will have a impact on my gridpanel, i suppose?

please :">
thomas

Animal
15 Oct 2010, 1:20 PM
For just one Record, a DataView is overkill.

Configure a Panel with tpl: '{...}', and update that Panel from the Record's data. To illustrate:



p = new Ext.Panel({
height: 100,
width: 200,
tpl: '{test}',
renderTo: document.body
});
p.update({test:'Hello world!'})

thomas.oberthanner
17 Oct 2010, 4:17 AM
brilliant.

thank you very much, that solves my problem AND increases performance...

cheers, tom