(function ($) {
$.fn.ggrid = function (options) {
$(this).datagrid(options);
var grid = this;
//键盘监听
$(window).keydown(function (event) {
var currentRowIndex = $(grid).datagrid("getRowIndex", $(grid).datagrid("getSelected"));
switch (event.keyCode) {
case 38:
$(grid).datagrid("unselectAll");
var allLins = $(grid).datagrid("getRows").length;
currentRowIndex = currentRowIndex == 0 ? allLins : currentRowIndex-1;
$(grid).datagrid("selectRow", currentRowIndex );
break;
case 40:
$(grid).datagrid("unselectAll");
var allLins = $(grid).datagrid("getRows").length;
currentRowIndex = currentRowIndex == allLins ? 0 : currentRowIndex+1;
$(grid).datagrid("selectRow", currentRowIndex );
break;
}
});
return grid;
}
})(jQuery);
分享到:
相关推荐
Datagrid键盘事件响应
EasyUi中DataGrid的键盘监听事件,对于表示一个很快捷的操作。
Datagrid实现双击行事件,供大家一起共同分享学习。
主要介绍了C#实现给DataGrid单元行添加双击事件的方法,较为详细的分析了C#给DataGrid单元添加双击事件的步骤及相关实现代码,具有一定参考借鉴价值,需要的朋友可以参考下
jQuery EasyUI Datagrid 用户列表鼠标悬停/离开数据行时显示人员头像(onMouseOver/onMouseOut) Demo 扩展 jQuery EasyUI Datagrid 数据行鼠标悬停离开事件,源码奉献!!!
easyUI datagrid 实现行上移,下移,置顶,置底,绑定键盘事件 键盘“↑”表示上移,键盘“↓”表示下移,键盘Ctrl+“↑”表示置顶,键盘Ctrl+“↓”表示置底。
easyui1.4.5增加一个鼠标滑过行,注意是行不是列,然后弹出框显示某些关键信息,如经典的图片预览操作,内容提供demo,并附修改方法,这个方法是修改的源码,没有增加扩展实现,若愿意请自行实现
datagrid curentchange事件
DataGrid双击事件&取值 请用vs2012打开
silverlight 4 + vs 2010 + xp 实现了dataGrid双击一行响应事件,代码大不份来自网络,自己做了个Dome 免分下载
Wince下 DataGrid编辑并捕捉键盘上下左右移动
NULL 博文链接:https://hjy2099.iteye.com/blog/260165
需要一个对datagrid控件进行的...不需要多余的界面进行添加修改等,利用datagrid的属性,事件等进行的直接操作。 注意:本例子是连接的odbc数据库,利用的时候可改变一下连接字符串,连接自己想要的数据库,方可运行。
DataGrid中加入ComboBox的源码
Datagrid键盘事件响应.以及 .NET环境下水晶报表使用总结 水晶报表是一个优秀的报表开发工具,在开发通用管理系统的时候,所有报表都使用水晶报表,其简单、易用和强大的功能令笔者倍加喜爱,现将水晶报表使用手记...
jeasyui-datagrid-datagrid 开发参考
DataGrid中嵌套DataGrid,修改后也适用DataGrid中嵌套DataList,DataList中嵌套DataList
关于对鼠标经过事件的使用,可以显示datagrid中的数据
DataGrid自定义列标题 DataGrid自定义列标题 DataGrid自定义列标题 DataGrid自定义列标题 DataGrid自定义列标题