addind new record to store doesn't exist, but it does?!

  1. #1

    addind new record to store doesn't exist, but it does?!

    So i'm using code taken straight from the examples, and below is an example of the configured listeners. I fill out the FormPanel and the click save - the code below fires (which I assume is Ext.Net code since I cannot find a sencha method called .addRecord():

            function saveChanges(str) {
                var df = Ext.getCmp("DetailForm");
    
                if (df.getForm().isValid()) {
                    var b = str.getAt(0) ? true : false;
                    
                    str.addRecord(df.getForm().getFieldValues(false, 'dataIndex'), b, true);
                    str.save();
    
                }
                else {
                    Ext.Msg.show({ icon: Ext.MessageBox.ERROR, msg: 'Form is invalid', buttons: Ext.Msg.OK });
                }
    
            }
    variable "b" = false in this case since the store is not loaded with data on page load (i am creating a new record)...however - when CommitDone fires (below), there is a record in the store - variable record is not UNDEFINED. However subsequent calls to saveChanges (above) end up creating new records instead of modifying the record that was added to the store on the first call (b remains undefined because str.getAt(0) = undefined) - but str.getAt(0) is NOT undefined in the CommitDone event....help?
                <Listeners>
                    <CommitDone Handler="var record = this.getAt(0) || {}; #{DetailForm}.getForm().loadRecord(record); #{DetailForm}.clearInvalid(); #{DetailForm}.body.unmask();" />
                    <DataChanged Handler="var record = this.getAt(0) || {}; #{DetailForm}.getForm().loadRecord(record); #{DetailForm}.clearInvalid();" />
                    <BeforeLoad Handler="#{DetailForm}.body.mask('Loading...', 'x-mask-loading');" />
                    <Load Handler="#{DetailForm}.body.unmask();" />
                    <LoadException Handler="#{DetailForm}.body.unmask();" />
                    <BeforeSave Handler="#{DetailForm}.body.mask('Loading...', 'x-mask-loading');" />
                </Listeners>      
            </ext:Store>
  2. #2
    Hi,

    It's hard to perceive all details that you described.

    Please provide a sample to reproduce the problem. Please simplify that sample as much as you can.

Similar Threads

  1. [CLOSED] gridPanel after edit event doesn't exist
    By Daly_AF in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 15, 2012, 10:22 AM
  2. [CLOSED] Click listener doesn't exist within Node component
    By Daly_AF in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 06, 2012, 12:21 PM
  3. [CLOSED] MiniListWidth doesn't exist within combobox list config
    By Daly_AF in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 19, 2012, 5:09 PM
  4. Addind columns to Gridpanel and store
    By toinho in forum 1.x Help
    Replies: 4
    Last Post: May 17, 2010, 4:27 PM
  5. [CLOSED] Adding a new Store Record - Not a Record object
    By Steve in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 15, 2009, 7:40 AM

Posting Permissions