Hybrid View
-
14 Feb 2012 8:31 AM #1
Panel and tpl with store?
Panel and tpl with store?
I have a panel in Designer 2 which i need to fill with some columns/rows, just like a html table.
I see that the Panel has the 'tpl' attribute, but i don't see how i can add a store to it. My store has JSON data, and i want to display this data as html inside that panel.
How can i do this..?? What would be a good way??
-
14 Feb 2012 12:43 PM #2
There are a couple of different solutions for what you are looking for.
If you already have the data in a Store then the one that you probably want is to put an Ext.view.View into your Panel and use a layout of fit. This will stretch the view to 100% width and height of the panel it is in.
Bind the View to the store of your choosing. Then configure a tpl for the View. Every record will be passed in a loop to the template in a tpl for="." loop.Aaron Conran
@aconran
Sencha Architect Development Team
-
15 Feb 2012 5:18 AM #3
I couldn't find the Ext.view.View, but i did find Ext.dataview.DataView. I guess that's the one you mean. I can tell it what store to load and i can change its 'tpl' property. So its working for me. Thanks.
-
15 Feb 2012 6:25 AM #4
Guess it didn't work after all

I added the store to the dataview and added the following in the itemTpl property:
All this gives me is the first item of the JSON data. I also tried it without the <for> loop, but that didn't help either.Code:<tpl for="."> <div style="width:100px; height:80px; background:#CCC;"> {Name} </div> </tpl>
Any idea what the problem could be? Perhaps a bug?
-
15 Feb 2012 8:07 AM #5
Make sure you have store configured correctly (See Store/Proxy/Reader docs).
Check the record count after data load.Bharat Nagwani
Sencha Designer Development Team
-
16 Feb 2012 4:48 AM #6


Reply With Quote