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;
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?