|
@@ -537,9 +537,9 @@ var TREE_SHEET_HELPER = {
|
|
|
$editor.css("background", 'white');
|
|
|
$editor.css("width", cellRect.width);
|
|
|
$editor.css("height", cellRect.height);
|
|
|
- $editor.attr("gcUIElement", "gcEditingInput");//padding:0 //value="${context.sheet.getValue(context.row,context.col)}"
|
|
|
+ //$editor.attr("gcUIElement", "gcEditingInput");//padding:0 //value="${context.sheet.getValue(context.row,context.col)}"
|
|
|
$editor.html(` <div class="input-group input-group-sm">
|
|
|
- <input type="text" id="esInput" class="form-control" aria-label="Text input with dropdown button" autocomplete="off" style=" background-color:${cellStyle.backColor}">
|
|
|
+ <input type="text" id="esInput" class="form-control" autocomplete="off" style=" background-color:${cellStyle.backColor}">
|
|
|
<div class="">
|
|
|
<div class="triangle-border_dropdown tb-border_dropdown" id="esBtn" style="z-index:10; left: ${cellRect.width - 15+"px"};top:${cellRect.height/2-2+"px"}"></div>
|
|
|
</div>
|
|
@@ -578,23 +578,30 @@ var TREE_SHEET_HELPER = {
|
|
|
},function(){
|
|
|
$(this).css("background-color","");
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
$("#esBtn").bind('click',function(e){
|
|
|
$(".es-list").toggle();
|
|
|
});
|
|
|
if( $('#esInput').val()) setCursor( $("#esInput")[0], $('#esInput').val().length)
|
|
|
});
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ TreeNodeCellType.prototype.processKeyDown = function (e, context){ //当用isReservedKey 不拦截编辑模式时的input框ctrl + c时,在非编辑模式的ctrl + c事件也需要自已处理,所以在这里再调用一下复制命令
|
|
|
+ //console.log(tree)
|
|
|
+ if(e.keyCode === GC.Spread.Commands.Key.c && e.ctrlKey) context.sheet.getParent().commandManager().execute({cmd:"copy",sheetName:context.sheet.name()});
|
|
|
+ };
|
|
|
+ TreeNodeCellType.prototype.isReservedKey = function (e, context) {
|
|
|
+ return e.keyCode === GC.Spread.Commands.Key.c && e.ctrlKey && !e.shiftKey && !e.altKey;//不拦截ctrl + c事件。
|
|
|
};
|
|
|
TreeNodeCellType.prototype.setEditorValue = function (editor, value, context) {
|
|
|
|
|
|
$('#esInput').val(value);
|
|
|
};
|
|
|
TreeNodeCellType.prototype.getEditorValue = function (editor, context) {
|
|
|
- this.isEscKey = false;
|
|
|
console.log($('#esInput').val());
|
|
|
return $('#esInput').val()!==''? $('#esInput').val():null;
|
|
|
};
|
|
|
+
|
|
|
}
|
|
|
return new TreeNodeCellType();
|
|
|
|
|
@@ -758,4 +765,4 @@ var TREE_SHEET_HELPER = {
|
|
|
};
|
|
|
return new QuestionCellType();
|
|
|
}
|
|
|
-};
|
|
|
+};
|