Jan 24, 2014, 10:41 PM
[CLOSED] Ext.Msg.confirm, making it synchronous
Is there any way I can make this synchronous?
Basically, I'm detecting if the grid is dirty before a user can add a row, or re-order rows, or change a a variety of things...
I'd like to execute diff method based on response...problem is, the method doesn't wait until the response!!!
And call it like:
Basically, I'm detecting if the grid is dirty before a user can add a row, or re-order rows, or change a a variety of things...
I'd like to execute diff method based on response...problem is, the method doesn't wait until the response!!!
isGridDirty: function (c) {
var recs = App.ContentPlaceHolder1_store.getModifiedRecords();
var dirty=-1
if (recs.length != 0) {
Ext.Msg.alert(CONFIRMS.DIRTYGRID.Title, CONFIRMS.DIRTYGRID.Message.format(c.Message), function (btn) {
if (btn == 'yes') {
PerformanceMetrics.saveContents(c.CloseWordUI);
dirty = false;
}
else
dirty = true;
});
}
},
And call it like:
if (!PerformanceMetrics.isGridDirty(DIRTYGRID.ADJUSTMENT)) {
App.direct.AddAdjustmentMetric(record.data, {
success: function (newRec) {
try {
if (newRec.PortfolioPerformanceTitleId != undefined) {
App.ContentPlaceHolder1_grid.getStore().add(newRec);
App.ContentPlaceHolder1_grid.getStore().commitChanges();
App.ContentPlaceHolder1_grid.getView().refresh();
App.ContentPlaceHolder1_grid.doLayout();
}
}
catch (e) {
alert(e.message);
}
}
});
}
OR if (!PerformanceMetrics.isGridDirty(DIRTYGRID.CURRENCY, newCurr))
App.direct.UpdateCurrency(App.ContentPlaceHolder1_cmboQuarters.getValue(), newCurr);
else
App.ContentPlaceHolder1_cmboCurrency.setValue(oldCurr);
Last edited by Daniil; Jan 28, 2014 at 5:24 AM.
Reason: [CLOSED]