easyUI双击事件,完整总结

我上一篇双击总结文章,然后这是另一种实现方法
/ 双击事件
var showSelectedSurveryDataOnMap=function(rowIndex,currentRow){
// console.info(rowData);
$('#title').text(currentRow.title);
$('#corpName').text(currentRow.corpName);
$('#createTime').text(currentRow.createTime);
$('#nr').html(currentRow.dutyContent);
   $("#content").show().dialog({
                    fit:"true",    
                    modal:true ,
                    showType:'show',
                    cache:false,
                    collapsible:false,
                    title:'查看内容',
                    minimizable:false,
                    maximizable:true,
                    closable:false,
                    draggable:false,
                    buttons:[{
                        text:"关闭",
                        iconCls:'icon-no',
                        handler:function(){
                            $('#content').dialog('close');
                         //   window.location.reload();//刷新当前页面.
			return;
                        }
                    }]
                });


}

这种实现效果是

easyUI双击事件,完整总结_第1张图片


然后此时遇到一个BUG 就是双击行时候,一直显示的 是第一条数据,我重新翻了翻demo然后重新做了一个方法


引入一个 dialog 默认是关闭的状态,然后在 双击事件里面加入行元素的field大功搞成,

 onDblClickRow :function(rowIndex){ 
  				var currentRow =$("#MessPubList").datagrid("getSelected");
            	$('#Dcontent').dialog('open');
            	$('#title').text(currentRow.title);
				$('#createTime').text(currentRow.createTime);
				$('#nr').html(currentRow.messContent);
  				},


留念,有需要的朋友可以参考一下,共同进步。


你可能感兴趣的:(总结)