BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
$(function () {
$("#Spreadsheet").ejSpreadsheet({
//...
beforeOpen: "beforeCMenuOpen"
});
});
function beforeCMenuOpen(args) {
var cMenuObj, newDataSource;
if ($(args.target).hasClass("e-rowheader")) {
cMenuObj = $("#" + this._id + "_contextMenuRowHeader").data("ejMenu");
//Here we can get the default dataSource of context menu
//var defaultDataSource = cMenuObj.model.fields.dataSource
//Change menu options
newDataSource = [
//...
];
if (JSON.stringify(cMenuObj.model.fields.dataSource) !== JSON.stringify(newDataSource)) {
cMenuObj.setModel({ fields: { dataSource: newDataSource } });
//...
}
}
args.cancel = true; //Prevent default process here
}
|