Results 1 to 3 of 3

Thread: Not able to view store in the Dataview

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default Not able to view store in the Dataview

    I am trying out a simple dataview code, but the store is not displayed in the dataview.
    image.jpg
    Here is the code
    ::
    Ext.Loader.setConfig({ enabled: true });
    Ext.require([
    'Ext.data.*',
    'Ext.util.*',
    'Ext.panel',
    'Ext.view.View'
    ]);

    Ext.onReady(function () {
    Ext.define('entryModel',
    {
    extend: 'Ext.data.Model',
    fields: [{ name: 'layer', type: 'string' }, { name: 'date', type: 'date' }, { name: 'entry', type: 'string'}]
    // hasMany: { model: 'accountModel', name: 'accounts' }
    });


    var store1 = Ext.create('Ext.data.Store', {
    model: 'entryModel',

    data: [
    { layer: 'GAAP', date: '2010-01-15 00:00:00', entry: 'AJE1' },
    { layer: 'StateTax', date: '2010-01-15 00:00:00', entry: 'AJE2'}
    ],
    autoLoad: true


    });

    var tpl = new Ext.XTemplate(
    '<tpl for ".">',
    '<p class="item">layer = {layer} </p>',
    '</tpl>'
    );

    var dataView = new Ext.DataView({
    store: store1,
    tpl: tpl,
    autoHeight: true,
    multiSelect: true,
    overClass: 'x-view-over',
    itemSelector: 'p.item',
    emptyText: 'No items to display'
    });

    Ext.create('Ext.Panel', {
    id: 'images-view',
    frame: true,
    collapsible: true,
    width: 535,
    renderTo: 'dataview-example',
    items: [dataView],
    title: 'Simple DataView '

    });
    });

  2. #2
    Sencha User
    Join Date
    Feb 2010
    Posts
    125
    Answers
    7
    Vote Rating
    3
      0  

    Default

    You may change your dataview to a simple grid with some columns to see if its a problem with the store or with the dataview or the template...

  3. #3
    Sencha User
    Join Date
    Feb 2010
    Posts
    125
    Answers
    7
    Vote Rating
    3
      0  

    Default

    Hm .. you also should add id values to your data array...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •