Results 1 to 2 of 2

Thread: Rowedtor emptyRecord.store is null if added to an empty store

  1. #1
    Sencha User lfs2008's Avatar
    Join Date
    Oct 2010
    Location
    Russia
    Posts
    66
    Answers
    1

    Default Rowedtor emptyRecord.store is null if added to an empty store

    Hi all!


    I have such a button handler in Extjs 4.1.0 controller.


    Restful store is already loaded.
    If i start editing any record - it works fine.
    If i add emptyRecord to non-empty store - it works fine.

    The issue is - emptyRecord.store is null if emptyRecord added to an empty store (0 records were loaded).
    Ext.create() just returns record store 'null' with no exceptions.
    Even more - emptyRecord.store stills null even after i manually set
    Code:
    emptyRecord.store = store.
    Thus after completeEdit methood call in Roweditor.js nothing happend - because emptyRecord not bound to any store.
    Editor just being hidden and no ajax call performed.What should i debug next? any clues?

    Code:
     ...
       var grid = Ext.getCmp('app-id-dataconsumerspanel'),
                _model = 'te.model.DataConsumer',
                _store = 'te.store.DataConsumer',
                store = Ext.getStore(_store),
                rowEditing = grid.plugins[0]
    
    
    
    
    
            var emptyRecord = Ext.create(_model , {
                name:'',
            });
            
            if (!emptyRecord.store){
            emptyRecord.store = store;
            }
            
            console.log(emptyRecord);
    
    
    
    
          store.insert(0, emptyRecord);
          rowEditing.startEdit(emptyRecord, 0);

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Once you do the store.insert it should be fine. Did you try just passing in an empty object to the store? Is the model you are creating the same model that is specified in the store? Did you set a breakpoint on the store.insert to see what happens?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Tags for this Thread

Posting Permissions

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