Question

I have a record which consists of approx 35-40 fields. When I try to set the value for 4-5 fields and try record.endEdit() it takes around 450 ms to be completed. Any idea on how I can reduce the processing time for it?

Was it helpful?

Solution

The time seems really strange you could override endEdit() with some timers to see what takes so long:

endEdit : function(silent, modifiedFieldNames){
    console.time("endEdit");
    var me = this,
        dataSave,
        changed;

    silent = silent === true;
    if (me.editing) {
        me.editing = false;
        dataSave = me.dataSave;
        me.modifiedSave = me.dataSave = me.dirtySave = null;
        if (!silent) {
            if (!modifiedFieldNames) {
                console.time("getModifiedFieldNames");
                modifiedFieldNames = me.getModifiedFieldNames(dataSave);
                console.timeEnd("getModifiedFieldNames");
            }
            changed = me.dirty || modifiedFieldNames.length > 0;
            if (changed) {
                console.time("afterEdit");
                me.afterEdit(modifiedFieldNames);
                console.timeEnd("afterEdit");
            }
        }
    }
    console.timeEnd("endEdit");
}

this will print 3 times to the console so you can see what function takes so long

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top