另外我想实现这个效果,参考了
SpreadNETWeb3\Samples\VB\SpreadDemo2005」的clientside和clientside2
但是发现当触发事件监听的JS时,AddKeyMap事件就无效了,请帮忙看下- <script type="text/javascript" >
-
- function editCell(e){
- var e=e||window.event;
- var s=e.target||e.srcElement;
- var cell=s.GetCellByRowCol(e.Row,1);
- s.StartEdit(cell);
- }
- function set_edit(e){
- var s1=document.getElementById('<%=FpSpread0.ClientID %>');
- s1.AddKeyMap(13,false,false,false,"this.MoveToNextRow()");
- s1.AddKeyMap(13,false,true,false,"this.MoveToPrevRow()");
- s1.StartEdit();
- addEvent(s1,"ActiveCellChanged",editCell);
- }
- function addEvent(obj,type,fn){
- if(document.all)
- obj.attachEvent('on'+type,fn);
- else
- obj.addEventListener(type,fn,false);
- }
- </script>
复制代码 |