1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    8
    Vote Rating
    0
    jvfiel is on a distinguished road

      0  

    Default problem with adding records

    problem with adding records


    Im trying to add multiple records at the same time, but it wont let me. As what i have observe in my firebug, my js is just sending the same records at the same time.

    Code snippet:

    for(i=first;i<=last;i++){
    var addtimeslot = timeIn.getStore().getAt(i).get('timeslot');
    key[i] = addroom+adddate+addtimeslot;


    schedstore.add({name:name,room:addroom,date:adddate,timeslot:addtimeslot,key:key[i]})


    }

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    7,183
    Vote Rating
    194
    scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold

      0  

    Default


    Are addtimeslot and key[i] unique when adding? The other fields seem static.
    We need more info.

    Scott.

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    2
    Vote Rating
    0
    rakshyas is on a distinguished road

      0  

    Default Facing problems while doing multiple add records. Any solutions?

    Facing problems while doing multiple add records. Any solutions?


    I am new to the coding and ExtJS and am also facing problems with this topic.
    I have an array of records and need to perform multiple inserts into the datastore.
    I am using the following code snippet under the save button for adding records:

    if (selectionValue==2){
    console.log("step 1");
    for (i=0; i<areaArray.length; i++){
    storeVendor.beginEdit();
    storeVendor.set("store_number",parseInt(areaArray[i]));
    storeVendor.set("vendor_number",Ext.getCmp("vendorPicker").getValue());
    app.storeToVendorStore.add(storeVendor);
    storeVendor.commit();
    }
    storeVendor.endEdit();
    app.storeToVendorStore.save();
    Ext.getCmp("storeVendorsWindow").destroy();
    app.storeToVendorStore.reload();
    }

    The array has 12 records right now. This code gets the job done..but Firefox repeatedly keeps on giving the warning message "Unresponsive script. A scripton the script may be busy, or....." . i have to hit continue multiple times before all the records are added.

    Any solutions or advice as to why this might be happening?