- 注册时间
- 2019-2-14
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 27
- 精华
- 0
- 帖子
- 0
|
DataGrid的Cell编辑状态下,(数量列直接处于编辑状态),使用键盘的Up ArrowDw Arrow,都没有任何反应。
<div id="List" class="mini-treegrid" style="width:100%;height:100%;" showTreeIcon="true" treeColumn="AssetName"
idField="ID" parentField="ParentID" multiSelect="false" resultAsTree="false" expandOnLoad="false" virtualScroll="true"
allowCellWrap="true" allowCellEdit="true" editNextOnEnterKey="true">
<div property="columns">
<div field="check" type="checkcolumn"></div>
<div name="AssetName" field="AssetName" width="100px" headerAlign="center" allowSort="true">易耗品名称</div>
<div field="Brand" width="70px" headerAlign="center" allowSort="true">品牌</div>
<div field="GSpecial" width="70px" headerAlign="center" allowSort="true">型号</div>
<div field="Num" width="50px" headerAlign="center">数量</div>
<div field="Total" width="70px" headerAlign="center">金额</div>
</div>
</div>
<script type="text/javascript">
mini.parse();var ListGrid = mini.get("List");
ListGrid.loadList( [{AssetName:"1",Brand:"",GSpecial:"",Num:1,Total:10}], "ID", "ParentID");
var sorter = new TreeSort(ListGrid);
ListGrid.on("cellmousedown",function(e){ var record=e.record,column = e.column;
if (column.name == "Num") {
if (e.keyCode == 38) {
alert("向上键");
}
if (e.keyCode == 40) {
alert("向下键");
}
}
});
ListGrid.focus(); var Cell=[0,4]; var cellrow = ListGrid.getRow(0);
var cellcolumn = ListGrid.getColumn(4);
ListGrid.setCurrentCell([cellrow, cellcolumn]);
ListGrid.beginEditCell();
</script>
|
|