Saturday 15 February 2014

ExtJS Costum store representation -


I think if there is an ExtJS method that I can load the store with data and after loading I Can I create my other components (custom panel) for displaying this data in my specific way in the panel?

Enter image details here

I have a list of my custom components I want to display data from the store in the panels

You have two options: < Ol>

  • If you only need to display the data then it is ready for this task.
  • If you really need a component (i.e., user interaction and not only the display), then you need to create this component and as your store creates one component per load and it is your own Add to master panel.

    To copy the example of Datative (option 1):

      Ext.define ('Image', {extension: 'Ext.data.Model ', Field: [{name:' src ', type:' string '}, {name:' caption ', type:' st ring '}]}); Ext.create ('Ext.data.Store', {id: 'imagesStore', Model: 'Image', Data: [[src: 'http: //www.sencha.com/img/20110215-feat-drawing Png ', Caption:' drawing and charts '}, {src:' http: //www.sencha.com/img/20110215-feat-data.png ', caption:' Advanced Data '}, {src:' Http: //www.sencha.com/img/20110215-feat-html5.png ', caption:' overhold theme '}, {src:' http: //www.sencha.com/img/20110215-feat-perf.png ', Caption:' display tune ')]}); Var imageTpl = New Ext.XTemplate ('& lt; tpl for = "." & Gt;', '& lt; div style = "margin-down: 10px;" class = "thumb-wrap">, '& Lt; img Src = "{src}" />,'  & lt; span & gt; {caption} & lt; / span & gt; & # 39; & # 39; & lt; ; / Div & gt; ',' & lt; / tpl & gt;); Ext.create ('Ext.view.View', {store: Ext.data.StoreManager.lookup ('imagesStore'), tpl: imageTpl, item selector: 'div.thumb-wrap', empty text: 'No image available No ', RenderTo: Ext.getBody ()});    

  • No comments:

    Post a Comment