SheetAPI.addCalculateExceptions method is used to add customized calculate operation. It allows you define your calculation. These calculations will be passed to the sheet calculate system, so user can use these calculations in the cell. Online demo.
SHEET_API = Ext.create('EnterpriseSheet.api.SheetAPI', {
openFileByOnlyLoadDataFlag: true
});
/*
* add a new calculate exception
*/
SHEET_API.addCalculateExceptions({
'NEW_EXCEPTION_1': function(e){
return {
title: 'New Exception 1',
msg: 'This is a customer defined new exception',
code: '#EXP1!'
}
}
});
After the above method is implemented, a new pre-defined exception "NEW_EXCEPTION_1()" is inserted into the system.
And you can use this exception in your customized function code.Click add Calculates method to see detail information about SheetAPI.addCalculates.