easyUI datagrid 双击某一行弹出dialog

  1.  jQuery('#user-grid').datagrid({  
  2.             url: basePath + 'user-manager-list.html',  
  3.             width: 870,  
  4.             height: 338,  
  5.             fitColumns: true,  
  6.             pagination:true,  
  7.             rowIndex:'login_name',  
  8.             singleSelect:true,  
  9.             toolbar:  
  10.                     [  
  11.                         {text:'添加',iconCls :'icon-add',handler:newUser} ,  
  12.                         {text:'编辑, iconCls:'icon-edit', handler:editUser },  
  13.                         {text:'删除, iconCls:'icon-remove',handler:removeUser }  
  14.                     ],  
  15. // 双击函数
  16.             onDblClickRow:function() {  
  17.                 editUser();  
  18.             },  
  19.             columns:[  
  20.                 [  
  21.                     {field:'login_name',title:'登录名称,width:120},  
  22.                     {field:'employ_id',title:'员工号码,width:80},  
  23.                     {field:'email',title:'邮件地址,width:200,align:'right'},  
  24.                     {field:'status',title:'状态,width:200,align:'center'},  
  25.                     {field:'expiry_date',title:'到期日期',width:160},  
  26.                     {field:'create_date',title:'创建日期,width:160,align:'center'}  
  27.                 ]  
  28.             ]  
  29.         });  
  30.   
  31. }  
  32.   
  33. </script>  
  34.   
  35. var customOBJ;  
  36. $('#customobjList').datagrid({     
  37.                 width:500,   
  38.                 height:200,   
  39.                 pageSize:5,  
  40.                 pageList:[5,15,20,25,30,35,40],  
  41.                 singleSelect:true,  
  42.                 nowrap:false,  
  43.                 url:'${basePath}/marketPlat/addDataServlet?method=seachOwnCustomobj',  
  44.                 onLoadSuccess:function(data){  
  45.                     //alert(data.rows.length);  
  46.                 },  
  47. // 双击函数
  48.                 onDblClickRow:function(rowIndex, rowData){  
  49.                     customOBJ=new Object();                      
  50.                     customOBJ.customobjId=rowData.customObjId;  
  51.                     customOBJ.customobjName=rowData.name;  
  52.                     setCustomobjName(customOBJ);  
  53.             //其中rowData.customObjId 对应后天的json数据   
  54.             show(customOBJ.customobjId);  
  55.                 },  
  56.                 columns:[[              
  57.                     {field:'name',title:'客户单位全称',width:180,align:'left',  
  58.                         formatter:function(value,rowData,rowIndex){  
  59.                             //alert(value);  
  60.                             return value;  
  61.                         }  
  62.                     },  
  63.                     {field:'industry',title:'所属行业',width:150,align:'center'},  
  64.                     {field:'regionType',title:'客户类别',width:150,align:'center'}  
  65.                 ]],  
  66.                 pagination:true  
  67.             });      
  68. function show(id)  
  69. {  
  70. var url='${basePath}/page/marketPlat2/addData/seachProduct_list.jsp?type='+id;  
  71.     var productWin=$('#product-window').window({  
  72.             href:url,  
  73.             title:'选择产品',              
  74.             closed: true,  
  75.             minimizable:false,  
  76.             collapsible:false,  
  77.             maximizable:false,      
  78.             cache:false,  
  79.             shadow:false  
  80.         });  
  81. productWin.window('open');  
  82. }  
posted @ 2015-03-05 16:34  庄姜琴瑟  阅读(4511)  评论(0编辑  收藏  举报