调用StartEdit进入编辑状态
http://help.grapecity.com/spread ... CSSR-StartEdit.html
还是建议您去看下SpreadJS,好用很多。
我写了个Demo你试下
- <script lang="javascript" type="text/javascript">
- window.onload = function () {
- var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
- spread1.AddKeyMap(13, false, false, false, "element.StartEdit()");
- if (document.all) {
- // IE
- if (spread1.addEventListener) {
- // IE9
- spread1.addEventListener("EditStart", cellChanged, false);
- } else {
- // Other versions of IE and IE9 quirks mode (no doctype set)
- spread1.onEditStart = cellChanged;
- }
- }
- else {
- // Firefox
- spread1.addEventListener("EditStart", cellChanged, false);
- }
- function cellChanged(event) {
- console.log(event, spread1)
- setTimeout(function () {
- document.getElementsByClassName("DefaultTextEditor")[0].select();
- }, 10)
- }
- }
- </script>
复制代码 |