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
    9,168
    Vote Rating
    119
    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 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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."