PDA

View Full Version : Components inside DataView



timmkd
27 Aug 2017, 8:47 PM
I don't seem to be able to include a component inside a DataView. Is this by design? If so, what would the best way to implement something along the lines of:

tpl = data => <Panel title={data.title}/>

render(){
return <DataView store={store} itemTpl= {tpl} />
}


Something like the above will output something like:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Although it works fine if I change tpl to
tpl = data => <p title={data.title}>{data.title}</p>;

Mark.Brocato
28 Aug 2017, 5:51 AM
DataView doesn't support rendering ExtReact components as children at the moment. You either use it's subclass List, which does, or loop through the store yourself to produce the panel components.