$(document).ready(function () { var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); function CustomMenuView() { } CustomMenuView.prototype = new GC.Spread.Sheets.ContextMenu.MenuView(); CustomMenuView.prototype.createMenuItemElement = function (menuItemData) { var self = this; var menuItemView = GC.Spread.Sheets.ContextMenu.MenuView.prototype.createMenuItemElement.call(self, menuItemData); if (menuItemData.name === "markWithABg") { var subMenuView = menuItemView.find(".gc-ui-contextmenu-container"); $(subMenuView[0]).colorpicker(); } return menuItemView; }; });