Managing Sheet with APIs

SheetAPI.addCalculateExceptions



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.addCalculateExceptions( calExceptions )

Parameters This method is used to add customized calculate exception. It allows you define your calculate exception. These exceptions will be passed to the sheet calculate system, so when there is a matched exception happened during the calculating, there will be a red tip on the cell to show some exception information to the user.

Example code for a simple calculate function


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.

 

 


Copyright © FeyaSoft Inc. All rights reserved.