FarPoint Spread for ASP.Net 回车响应
<FarPoint:FpSpread ID="FpSpread1" runat="server" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" style="z-index: 1; left: 10px; top: 93px; position: absolute; height: 332px; width: 932px"><commandbar backcolor="Control" buttonfacecolor="Control" buttonhighlightcolor="ControlLightLight" buttonshadowcolor="ControlDark">
</commandbar>
<sheets>
<FarPoint:SheetView SheetName="Sheet1">
</FarPoint:SheetView>
</sheets>
</FarPoint:FpSpread>
现在用的是FarPoint Spread for ASP.Net 4.0
希望在进入页面后,
1. FpSpread1默认直接进入编辑状态,这段代码如何写?
2.希望在FpSpread1编辑时,按回车后,自动跳到下一个单元格,如果是最后一个单元格,则自动跳到下一行的第一列,请问如何编写?
用的是VB.Net 1. 前端还没有加载完成的事件,您可以在页面加载完成后,用setTimeout调用StartEdit,开始编辑。
https://help.grapecity.com/spread/SpreadNet12/ASP2/webframe.html#CSSR-StartEdit.html
2. 绑定回车给 MoveToNextCell
https://help.grapecity.com/spread/SpreadNet12/ASP2/webframe.html#CSSR-AddKeyMap.html 那个回车响应能不能给出一个代码?我现在样设置了,没反应
客户端脚本
<script type="text/javascript">
function setMap() {
var ss = document.getElementById("FpSpread1");
alert("测试");
if (ss != null){
//IE9 or earlier
//ss.AddKeyMap(13,true,true,false,"this.MoveToLastColumn()");
ss.AddKeyMap(13,true,true,false,"element.MoveToLastColumn()");
}
</script>
window.onload = function() {
var spread1 = document.getElementById("FpSpread1");
spread1.AddKeyMap(13, false, false, false, function() { var ss = spread1; ss.MoveToLastColumn(); });
}
FarPoint Spread在哪一个事件中设置
我目前是在ActiveCellChange里面设置的,没反应,在表格中回车直接就刷新页面了
<FarPoint:FpSpread ID="FpSpread1" runat="server" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" style="z-index: 1; left: 10px; top: 93px; position: absolute; height: 332px; width: 932px">
<commandbar backcolor="Control" buttonfacecolor="Control" buttonhighlightcolor="ControlLightLight" buttonshadowcolor="ControlDark">
<Background BackgroundImageUrl="SPREADCLIENTPATH:/img/cbbg.gif"></Background>
</commandbar>
<sheets>
<FarPoint:SheetView SheetName="Sheet1">
</FarPoint:SheetView>
</sheets>
<ClientEvents ActiveCellChanged="setMap" />
<TitleInfo BackColor="#E7EFF7" ForeColor="" HorizontalAlign="Center" VerticalAlign="NotSet" Font-Size="X-Large"></TitleInfo>
</FarPoint:FpSpread>
如下代码测试没有问题。注意到您是很老的版本,您需要看下是否有对应方法。
<script>
window.onload = function () {
var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
spread1.AddKeyMap(13, false, false, false, function () { var ss = spread1; ss.MoveToNextCell(); });
}
</script>
页:
[1]