GcSpread.Sheets Namespace > CustomCellType type : isImeAware Method |
var instance = new GcSpread.Sheets.CustomCellType(); var value; // Type: boolean value = instance.isImeAware(context);
function isImeAware( context : object ) : boolean;
true
if the cell type is aware of IME; otherwise, false
.function NameCellType() { } NameCellType.prototype = new GcSpread.Sheets.CustomCellType(); NameCellType.prototype.updateEditor = function (editorContext, cellStyle, cellRect, context) { if (editorContext) { $(editorContext).width(cellRect.width); $(editorContext).height(cellRect.height + 20); } }; NameCellType.prototype.createEditorElement = function (context) { var div = document.createElement("div"); var $div = $(div); $div.attr("gcUIElement", "gcEditingInput"); $div.css("background-color", "white"); $div.css("position", "absolute"); $div.css("overflow", "hidden"); $div.css("border", "2px #5292f7 solid"); var $span1 = $("<span>Enter Your Name</span>"); $span1.css("display", "block"); var $input1 = $("<input type='text'/>"); $div.append($span1); $div.append($input1); return div; }; NameCellType.prototype.getEditorValue = function (editorContext, context) { if (editorContext) { var input1 = editorContext.children[1]; var name = $(input1).val(); return name; } }; NameCellType.prototype.setEditorValue = function (editorContext, value, context) { if (editorContext) { if (value) { var input1 = editorContext.children[1]; $(input1).val(value); } } }; NameCellType.prototype.focus = function (editorContext, context) { if (editorContext) { $(editorContext.children[1]).focus(); } }; NameCellType.prototype.isImeAware = function (context) { return true; } NameCellType.prototype.updateImeMode = function (editorContext, imeMode, context) { if (editorContext) { var $input = $(editorContext.children[1]); switch (imeMode) { case GcSpread.Sheets.ImeMode.Auto: $input.css("ime-mode", "auto"); break; case GcSpread.Sheets.ImeMode.Active: $input.css("ime-mode", "active"); break; case GcSpread.Sheets.ImeMode.Inactive: $input.css("ime-mode", "inactive"); break; case GcSpread.Sheets.ImeMode.Disabled: $input.css("ime-mode", "disabled"); break; } } } sheet.setCellType(1,1,new NameCellType());
The context parameter can include the following items:
Item | Type | Description |
context.sheet | GcSpread.Sheets.Sheet instance | Indicates the current sheet. |
context.row | number | The row index. |
context.col | number | The column index. |
context.sheetArea | GcSpread.Sheets.SheetArea | The current sheet area. |