zoukankan      html  css  js  c++  java
  • EasyUI使用之鼠标双击事件

    easyui鼠标双击事件,使用 onDblClickRow(index, row) 事件,在用户双击一行的时候触发,参数包括:

    • index:点击的行的索引值,该索引值从0开始。
    • row:对应于点击行的记录。
    $("#wu-datagrid-news").datagrid({
        loadFilter: pagerFilter,//分页
        rownumbers: true,//如果为true,则显示一个行号列。
        singleSelect: false,//如果为true,则只允许选择一行。
        multiSort: true,//定义是否允许多列排序。
        fitColumns: true,//真正的自动展开/收缩列的大小,以适应网格的宽度,防止水平滚动。
        fit: true,//自适应
       idField: 'id',//指明哪一个字段是标识字段
        loadMsg: 'Processing, please wait …',//在从远程站点加载数据的时候显示提示消息。
        pagination: true, //如果为true,则在DataGrid控件底部显示分页工具栏。
        
    columns: [[{ field:
    'id', //列字段名称 '100', //列的宽度。如果没有定义,宽度将自动扩充以适应其内容。 title: 'ID', //列标题文本 checkbox: true //复选框,该复选框列固定宽度。 }, { field: 'trainTitle', title: '标题', '300', align: 'center' }, { field: 'trainAuthor', title: '作者', '100', align: 'center' }, { field: 'trainBody', title: '正文', '500', align: 'center' }, { field: 'imgPath', title: '图片', '80', align: 'center', hidden:'true'//此列隐藏 }, { field: 'createTime', title: '创建时间', '150', align: 'center' } ]], onDblClickRow:function(rowIndex){//鼠标双击事件 $("#wu-datagrid-news").datagrid("selectRow",rowIndex);//选中此行 var currentRow = $("#wu-datagrid-news").datagrid("getSelected");//获得选中行的信息 //弹出框赋值 $("#newsTitle").val(currentRow["trainTitle"]); $("#newsAuthor").val(currentRow["trainAuthor"]); $("#newImg").attr('src',''); $("#newImg").attr('src',httpurl+'/'+currentRow["imgPath"]); $("#newsBody").val(currentRow["trainBody"]); $("#imgPath").hide(); $('#wu-dialog-news').dialog({//弹出框 closed: false, modal: true, title: "查看信息", buttons: [{ text: '确定', iconCls: 'icon-ok', handler: function () { $('#wu-dialog-news').dialog('close'); } }] }); } });
  • 相关阅读:
    第一个vbscript程序
    判定VBscript方法是否存在
    我的模块加载系统 v24
    libnet/libnids库函数介绍
    程序员应知道的12件事
    基于poll实现的echo服务器
    师者
    OSI/RM参考模型和TCP/IP协议的关系
    TCP(虚电路)和UDP的区别
    python中 __name__及__main()__的妙处
  • 原文地址:https://www.cnblogs.com/nananana/p/8625187.html
Copyright © 2011-2022 走看看