1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Dublin, California
    Posts
    12
    Vote Rating
    0
    drgaryholland is on a distinguished road

      0  

    Default How do you add a row of data to a store

    How do you add a row of data to a store


    I have a restful app that I am trying to add a button to a toolbar on a tab panel where the grid resides. The grid populates with data so now I want to add a button who's action would be add a blank row in the grid. I have tried cancelEdit() , store.insert(0, model) to no avail. I need someone to point me in the right direction. My store looks like this:

    //Thanks in advance

    Ext.define('ShopTrack.store.UserMasterStore', {
    extend: 'Ext.data.Store',
    alias: 'store.userMasterStore',


    requires: [
    'ShopTrack.model.User'
    ],


    constructor: function(cfg) {
    var me = this;
    cfg = cfg || {};
    me.callParent([Ext.apply({
    autoLoad: true,
    autoSync: true,
    filterOnLoad: false,
    sortOnLoad: false,
    storeId: 'userMasterStore',
    model: 'ShopTrack.model.User',
    proxy: {
    type: 'rest',
    url: 'http://localhost/services/webresources/shoptrack.usermaster/',
    reader: {
    type: 'xml',
    root: 'userMasters',
    record: 'userMaster'
    }
    }
    }, cfg)]);
    }
    });

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Location
    Dublin, California
    Posts
    12
    Vote Rating
    0
    drgaryholland is on a distinguished road

      0  

    Default


    I found the answer to my own question. Being the code editing features of Architect are limited and the fact I am new to Ext, I found that by assigning the instance of the store to a variable using getStore(StoreName) then using that vartiable to do a store.add(ModelRecord).

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    You are correct

    Code:
    store.add({ /* config */ });
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar