回复 1楼dxhshitc的帖子
你好,原因为 FF 不支持 IE 的 event.keyCode,需要进行判断 :
前台:
- <script type="text/javascript">
- function preventKey(e) {
- var code;
- if (e.keyCode) {
- code = event.keyCode;
- }
- else {
- code = e.which;
- }
- if (code == "61") {
- var spread = this.document.getElementById("<%=FpSpread1.ClientID %>");
- spread.EndEdit();
- return false;
- }
- }
- </script>
复制代码
后台:
- protected override void Render(HtmlTextWriter writer)
- {
- Table viewport = this.FpSpread1.FindControl("viewport") as Table;
- viewport.Attributes.Add("onkeypress", "preventKey(event)");
- base.Render(writer);
- }
复制代码 |