@
对工作中遇到的easyui做一下笔记,不定时更新
(1) 表格双击事件
datagrid和treegrid都适用,例子:
onDblClickRow :function(rowIndex,rowData){
var selections = $("#areaList").datagrid('getSelections');
var areaSeq = selections[0].areaSeq;
var areaName = selections[0].areaName;
var status = selections[0].tipsAreaRelaStatus;
if(status =='1'){
$.messager.alert("操作提示","已配置过该提示语,继续配置数据将覆盖旧数据!","warning");
return;
}
treeOption.addNodeToList(1,areaSeq,areaName,status);
}
(2) treegrid传参更新
var jsonData = {'queryFlag':flag,
'areaName':$('#areaName').val()
};
$('#areaList').treegrid({
queryParams: jsonData
});
var params = $("#areaList").treegrid("options").queryParams;
$("#areaList").treegrid("options").queryParams=params;
$("#areaList").treegrid("reload")
(3) 设置列表checkbox单选
easyui设置checkbox单选:singleSelect : true
(4) Easyui实现单行选择和取消选择
var isCheckFlag = true;
$('#flowList').datagrid({
....
onClickCell:function(rowIndex,field,value){
isCheckFlag = false;
},
onSelect:function(rowIndex,rowData){
if(!isCheckFlag){
$(this).datagrid('unselectAll');
isCheckFlag = true;
$(this).datagrid('selectRow', rowIndex);
}
},
onUnselect:function(rowIndex,rowData){
if(!isCheckFlag) {
isCheckFlag = true;
$(this).datagrid('unselectRow', rowIndex);
}
}
});
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/17042.html