// 获取选中一行的情况,下面的一个参数可以代表一个DataGrid
function getSelected(dialogEle,dataFileTextEle) {
// 获取选中一行的情况。
var datagrid = $("#fileInfoDataGrid").datagrid('getSelected');
if (datagrid == null) {
$.messager.alert('提示窗口','对不起,您还没有选择文件!','info');
} else {
if (datagrid.fileType == "文件夹") {
$.messager.alert('提示窗口','对不起,您选择的是文件夹,请您选择确切的文件!','info');
} else {
// 给这个文本域赋值
dataFileTextEle.attr("value", datagrid.filePath);
replaceExistedString(dataFileTextEle.attr("id"),dataFileTextEle.val());
dialogEle.dialog("close");
}
}
}

// 获取选中多行的情况
function getSelections() {
var ids = [];
var rows = $("#fileInfoDataGrid").datagrid('getSelections');
for (var i = 0; i < rows.length; i++) {
ids.push(rows[i].filePath);
}
}

// 选中指定行
function selectRow(rowNum) {
$("#fileInfoDataGrid").datagrid('selectRow', rowNum);
}

// 不选中指定行
function unselectRow(rowNum) {
$("#fileInfoDataGrid").datagrid('unselectRow', rowNum);
}

function clearSelections() {
$("#fileInfoDataGrid").datagrid('clearSelections');
}

//定义要填写路径的文本域
var dataFileTextEle;
$(function() {
$("#dialog-diskFileInfo").dialog({
resizable : false,
width : 1020,
modal : true,
show : "blind",
hide : "explode",
closeOnEscape : true,
autoOpen : false,
//draggable : true,
buttons : {
"确定" : function() {
getSelected($(this),dataFileTextEle);
},
"取消" : function() {
$(this).dialog("close");
}
}
});

// 带有class属性为openDiskFileInfoDialog的元素,为这个元素添加点击事件
$(".openDiskFileInfoDialog").bind("click", function() {
//dataFileTextEle = $($(this).attr("id"));
dataFileTextEle = $($(this).attr("id"));
// 加载数据
$("#diskFileStructureTree").tree({
checkbox : false,
url : basePath + "/onlinegraph/treeDataAction_treeNodes.action",
method : 'post',
animate : true,
dnd : true,
lines : true,
onClick : function(node) {
$("#fileInfoDataGrid").datagrid('load', {
page : 1,
rows : 10,
path : node.id
});
},
onBeforeExpand : function(node, param) {
$("#diskFileStructureTree").tree('options').url = basePath
+ "/onlinegraph/treeDataAction_treeNodeList.action?path="
+ node.id;
}
});

// 打开表格
$("#fileInfoDataGrid").datagrid({
// 通过这个获得参数
url : basePath
+ "/onlinegraph/fileInfoAction_folderFileInfoList.action",
// 行阴影,但目前看没有效果
striped : true,
method : 'post',
nowrap : false,
border : false,
singleSelect : true,
// 自适应窗口大小变化
fit : true,
title : '文件信息',
fitColumns : true,
rownumbers : true,
idField : 'filePath',
collapsible : true,
sortName : 'fileName',
// 排序规则
sortOrder : 'desc',
// 本地排序,不是在服务器端排
remoteSort : false,
frozenColumns : [[{
field : 'checkbox',
checkbox : true
}]],
columns : [[{
field : 'fileName',
title : '名称',
sortable : true,
width : 50
}, {
field : 'filePath',
title : '文件路径',
sortable : true,
width : 160
}, {
field : 'lastModified',
title : '修改日期',
sortable : true,
width : 100
}, {
field : 'fileType',
title : '类型',
sortable : true,
width : 50,
align : 'left'
}, {
field : 'fileSize',
title : '大小',
sortable : true,
width : 50,
align : 'left'
}]],
// 事件调用的方式
onLoadSuccess : function() {
},
onDblClickRow : function(index, row) {
if (row.fileType == "文件夹") {
$.messager.alert('提示窗口','对不起,您选择的是文件夹,请您选择确切的文件!','info');
} else {
// 给这个文本域赋值
dataFileTextEle.attr("value", row.filePath);
replaceExistedString(dataFileTextEle.attr("id"),dataFileTextEle.val());
$("#dialog-diskFileInfo").dialog("close");
console.info(params);
}
},
pagination : true
});

var p = $("#fileInfoDataGrid").datagrid('getPager');
$(p).pagination({
pageSize : 10,
pageList : [10, 20, 30, 40, 50, 100],
layout:['list','sep','first','prev','links','next','last','sep','refresh'],
beforePageText : '第',
afterPageText : '页  共{pages}页',
displayMsg : '当前显示 {from} - {to} 条记录   共 {total} 条记录',
showPageList : true,
showRefresh : true
});

$("#dialog-diskFileInfo").show().dialog("open");
});

// 插件的第一个参数表示的是弹出的dialog元素
// $.fn.diskFileDialogEleBtnCheckOk = function(dialogEle,
// diskFileStructureTree, fileInfoDataGrid) {
//
// // 获得选中列
// getSelected(dialogEle);
//
// // 获取选中多行的信息
// // getSelections();
//
// // 选中第二行
// // selectRow(2);
//
// // 不选中第三行
// // unselectRow(2);
//
// // 清除所有的选中行
// // clearSelections();
// }

});

EasyUI中tree,Datagrid,pagenation的使用EasyUI中Datagrid和pagenation进行关联时,再次点击pagenation时让表格数据显示的问题的更多相关文章

  1. 数据网格和树-EasyUI Datagrid 数据网格、EasyUI Propertygrid 属性网格、EasyUI Tree 树、EasyUI Treegrid 树形网格

    EasyUI Datagrid 数据网格 扩展自 $.fn.panel.defaults.通过 $.fn.datagrid.defaults 重写默认的 defaults. 数据网格(datagrid ...

  2. easyui中tree控件添加自定义图标icon

    来源于:http://blog.163.com/lintianhuanhai@126/blog/static/165587366201421704420256/ <!DOCTYPE html&g ...

  3. 做权限树时 使用EasyUI中Tree

    符合EasyUI中Tree的Json格式,我们先看一下,格式是如何的 [{ "id":1, "text":"My Documents", & ...

  4. easyui中tree型控件不正常显示的处理方法

    我在使用easyui中的tree控件时,出现不正常显示的现象,比如li中不能使用自定义的图标.父级展开或关闭时,其子级仍然显现并出现重叠等.找了很多资料,都没解决这个问题,后来逐个对照官方的源码,才找 ...

  5. 使用EasyUI中Tree

    easyui里面的加载tree的两种方式 第一种: 使用EasyUI中Tree 符合EasyUI中Tree的Json格式,我们先看一下,格式是如何的 [{ , "text":&qu ...

  6. easyUI 的tree 修改节点,sql递归查询

    1.easyUI 的tree 修改节点: 我需要:切换语言状态,英文下, 修改根节点文本,显示英文. 操作位置:在tree的显示 $('#tree').tree(),onLoadSuccess事件方法 ...

  7. 基于MVC4+EasyUI的Web开发框架经验总结(13)--DataGrid控件实现自动适应宽带高度

    在默认情况下,EasyUI的DataGrid好像都没有具备自动宽度的适应功能,一般是指定像素宽度的,但是使用的人员计算机的屏幕分辨率可能不一样,因此导致有些地方显示太大或者太小,总是不能达到好的预期效 ...

  8. 第二百二十六节,jQuery EasyUI,Tree(树)组件

    jQuery EasyUI,Tree(树)组件 本节课重点了解 EasyUI 中 Tree(树)组件的使用方法,这个组件依赖于 Draggable(拖 动)和 Droppable(放置)组件. 一.加 ...

  9. easyUI的tree

    前端使用easyUI,放了一个tree,搞死了. easyUI的tree,后端传过来的数据,是json格式:然后easyUI向后端提交.请求时,会自动将节点的id附在url后面. 主要有两个注意的地方 ...

随机推荐

  1. Android简易实战教程--第四十一话《vitamio网络收音机》

    在Android初级教程专栏里面,介绍了Android原生的VideoView和vitamio框架Android视频媒体相关,VideoView和开源框架vitamio.并演示了播放网络视频的对应的D ...

  2. An internal error occurred during: "Retrieving archetypes:". GC overhead limit exceeded

    An internal error occurred during: "Retrieving archetypes:".GC overhead limit exceeded 异常, ...

  3. iOS 10.0之前和之后的Local Notification有神马不同

    在iOS 10.0之前apple还没有将通知功能单独拿出来自成一系.而从10.0开始原来的本地通知仍然可用,只是被标记为过时.于是乎我们可以使用10.0全新的通知功能.别急-让我们慢慢来,先从iOS ...

  4. Android源码浅析(五)——关于定制系统,如何给你的Android应用系统签名

    Android源码浅析(五)--关于定制系统,如何给你的Android应用系统签名 今天来点简单的我相信很多定制系统的同学都会有一些特定功能的需求,比如 修改系统时间 静默安装 执行某shell命令 ...

  5. ROS新闻 Towards ROS-native drones 无人机支持方案

    PX4/Firmware:https://github.com/PX4/Firmware PXFmini An open autopilot daughter-board for the Raspbe ...

  6. RxJava操作符(05-结合操作)

    转载请标明出处: http://blog.csdn.net/xmxkf/article/details/51656736 本文出自:[openXu的博客] 目录: CombineLatest Join ...

  7. activiti 配置节点 连线信息获取

    1.1.1. 前言 当使用eclipse插件进行流程设计的时候,部署流程之后,我们如何获取我们定义的所有的节点.连线.关口等配置信息呢?有的人看到这个需求,不免窃喜,这不很简单嘛,重新打来bmpn中定 ...

  8. [Python监控]psutil模块简单使用

    安装很简单 pip install psutil 官网地址为 https://pythonhosted.org/psutil/ (文档上有详细的api) github地址为 https://githu ...

  9. actionbar详解(二)

    经过前面两篇文章的学习,我想大家对ActionBar都已经有一个相对较为深刻的理解了.唯一欠缺的是,前面我们都只是学习了理论知识而已,虽然知识点已经掌握了,但是真正投入到项目实战当中时会不会掉链子还很 ...

  10. EBS开发常用编译命令

    一.编译FORM 1.将脚本写成shell脚本 cd $AU_TOP/forms/ZHS export FORMS_PATH=.:$FORMS_PATH:$AU_TOP/forms/ZHS frmcm ...