升级easyUI到1.9.4版本
This commit is contained in:
64
erp_web/js/easyui/demo/treegrid/actions.html
Normal file
64
erp_web/js/easyui/demo/treegrid/actions.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>TreeGrid Actions - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>TreeGrid Actions</h2>
|
||||
<p>Click the buttons below to perform actions.</p>
|
||||
<div style="margin:20px 0;">
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="collapseAll()">CollapseAll</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="expandAll()">ExpandAll</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="expandTo()">ExpandTo</a>
|
||||
</div>
|
||||
<table id="tg" class="easyui-treegrid" title="TreeGrid Actions" style="width:700px;height:250px"
|
||||
data-options="
|
||||
iconCls: 'icon-ok',
|
||||
rownumbers: true,
|
||||
animate: true,
|
||||
collapsible: true,
|
||||
fitColumns: true,
|
||||
url: 'treegrid_data2.json',
|
||||
method: 'get',
|
||||
idField: 'id',
|
||||
treeField: 'name'
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name',width:180">Task Name</th>
|
||||
<th data-options="field:'persons',width:60,align:'right'">Persons</th>
|
||||
<th data-options="field:'begin',width:80">Begin Date</th>
|
||||
<th data-options="field:'end',width:80">End Date</th>
|
||||
<th data-options="field:'progress',width:120,formatter:formatProgress">Progress</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
function formatProgress(value){
|
||||
if (value){
|
||||
var s = '<div style="width:100%;border:1px solid #ccc">' +
|
||||
'<div style="width:' + value + '%;background:#cc0000;color:#fff">' + value + '%' + '</div>'
|
||||
'</div>';
|
||||
return s;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
function collapseAll(){
|
||||
$('#tg').treegrid('collapseAll');
|
||||
}
|
||||
function expandAll(){
|
||||
$('#tg').treegrid('expandAll');
|
||||
}
|
||||
function expandTo(){
|
||||
$('#tg').treegrid('expandTo',21).treegrid('select',21);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
34
erp_web/js/easyui/demo/treegrid/basic.html
Normal file
34
erp_web/js/easyui/demo/treegrid/basic.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Basic TreeGrid - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Basic TreeGrid</h2>
|
||||
<p>TreeGrid allows you to expand or collapse group rows.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table title="Folder Browser" class="easyui-treegrid" style="width:700px;height:250px"
|
||||
data-options="
|
||||
url: 'treegrid_data1.json',
|
||||
method: 'get',
|
||||
rownumbers: true,
|
||||
idField: 'id',
|
||||
treeField: 'name'
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name'" width="220">Name</th>
|
||||
<th data-options="field:'size'" width="100" align="right">Size</th>
|
||||
<th data-options="field:'date'" width="150">Modified Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
35
erp_web/js/easyui/demo/treegrid/checkbox.html
Normal file
35
erp_web/js/easyui/demo/treegrid/checkbox.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cascade CheckBox in TreeGrid - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Cascade CheckBox in TreeGrid</h2>
|
||||
<p>TreeGrid nodes with cascade check boxes.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table title="Folder Browser" class="easyui-treegrid" style="width:700px;height:250px"
|
||||
data-options="
|
||||
url: 'treegrid_data1.json',
|
||||
method: 'get',
|
||||
checkbox: true,
|
||||
rownumbers: true,
|
||||
idField: 'id',
|
||||
treeField: 'name'
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name'" width="220">Name</th>
|
||||
<th data-options="field:'size'" width="100" align="right">Size</th>
|
||||
<th data-options="field:'date'" width="150">Modified Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
189
erp_web/js/easyui/demo/treegrid/clientpagination.html
Normal file
189
erp_web/js/easyui/demo/treegrid/clientpagination.html
Normal file
@@ -0,0 +1,189 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Client Side Pagination in TreeGrid - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Client Side Pagination in TreeGrid</h2>
|
||||
<p>This sample shows how to implement client side pagination in TreeGrid.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table id="tg" title="Client Side Pagination" style="width:700px;height:250px"
|
||||
data-options="
|
||||
iconCls: 'icon-ok',
|
||||
rownumbers: true,
|
||||
animate: true,
|
||||
collapsible: true,
|
||||
fitColumns: true,
|
||||
url: 'treegrid_data2.json',
|
||||
method: 'get',
|
||||
idField: 'id',
|
||||
treeField: 'name',
|
||||
pagination: true,
|
||||
pageSize: 2,
|
||||
pageList: [2,5,10]
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name',width:180">Task Name</th>
|
||||
<th data-options="field:'persons',width:60,align:'right'">Persons</th>
|
||||
<th data-options="field:'begin',width:80">Begin Date</th>
|
||||
<th data-options="field:'end',width:80">End Date</th>
|
||||
<th data-options="field:'progress',width:120,formatter:formatProgress">Progress</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
(function($){
|
||||
function pagerFilter(data){
|
||||
if ($.isArray(data)){ // is array
|
||||
data = {
|
||||
total: data.length,
|
||||
rows: data
|
||||
}
|
||||
}
|
||||
var target = this;
|
||||
var tg = $(target);
|
||||
var state = tg.data('treegrid');
|
||||
var opts = tg.treegrid('options');
|
||||
if (!state.allRows){
|
||||
state.allRows = data.rows;
|
||||
}
|
||||
if (!opts.remoteSort && opts.sortName){
|
||||
var names = opts.sortName.split(',');
|
||||
var orders = opts.sortOrder.split(',');
|
||||
state.allRows.sort(function(r1,r2){
|
||||
var r = 0;
|
||||
for(var i=0; i<names.length; i++){
|
||||
var sn = names[i];
|
||||
var so = orders[i];
|
||||
var col = $(target).treegrid('getColumnOption', sn);
|
||||
var sortFunc = col.sorter || function(a,b){
|
||||
return a==b ? 0 : (a>b?1:-1);
|
||||
};
|
||||
r = sortFunc(r1[sn], r2[sn]) * (so=='asc'?1:-1);
|
||||
if (r != 0){
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
});
|
||||
}
|
||||
var topRows = [];
|
||||
var childRows = [];
|
||||
$.map(state.allRows, function(row){
|
||||
row._parentId ? childRows.push(row) : topRows.push(row);
|
||||
row.children = null;
|
||||
});
|
||||
data.total = topRows.length;
|
||||
var pager = tg.treegrid('getPager');
|
||||
pager.pagination('refresh', {
|
||||
total: data.total,
|
||||
pageNumber: opts.pageNumber
|
||||
});
|
||||
opts.pageNumber = pager.pagination('options').pageNumber || 1;
|
||||
var start = (opts.pageNumber-1)*parseInt(opts.pageSize);
|
||||
var end = start + parseInt(opts.pageSize);
|
||||
data.rows = topRows.slice(start, end).concat(childRows);
|
||||
return data;
|
||||
}
|
||||
|
||||
var appendMethod = $.fn.treegrid.methods.append;
|
||||
var removeMethod = $.fn.treegrid.methods.remove;
|
||||
var loadDataMethod = $.fn.treegrid.methods.loadData;
|
||||
$.extend($.fn.treegrid.methods, {
|
||||
clientPaging: function(jq){
|
||||
return jq.each(function(){
|
||||
var tg = $(this);
|
||||
var state = tg.data('treegrid');
|
||||
var opts = state.options;
|
||||
opts.loadFilter = pagerFilter;
|
||||
var onBeforeLoad = opts.onBeforeLoad;
|
||||
opts.onBeforeLoad = function(row,param){
|
||||
state.allRows = null;
|
||||
return onBeforeLoad.call(this, row, param);
|
||||
}
|
||||
var pager = tg.treegrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize){
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
tg.treegrid('loadData',state.allRows);
|
||||
}
|
||||
});
|
||||
tg.treegrid('loadData', state.data);
|
||||
if (opts.url){
|
||||
tg.treegrid('reload');
|
||||
}
|
||||
});
|
||||
},
|
||||
loadData: function(jq, data){
|
||||
jq.each(function(){
|
||||
$(this).data('treegrid').allRows = null;
|
||||
});
|
||||
return loadDataMethod.call($.fn.treegrid.methods, jq, data);
|
||||
},
|
||||
append: function(jq, param){
|
||||
return jq.each(function(){
|
||||
var state = $(this).data('treegrid');
|
||||
if (state.options.loadFilter == pagerFilter){
|
||||
$.map(param.data, function(row){
|
||||
row._parentId = row._parentId || param.parent;
|
||||
state.allRows.push(row);
|
||||
});
|
||||
$(this).treegrid('loadData', state.allRows);
|
||||
} else {
|
||||
appendMethod.call($.fn.treegrid.methods, $(this), param);
|
||||
}
|
||||
})
|
||||
},
|
||||
remove: function(jq, id){
|
||||
return jq.each(function(){
|
||||
if ($(this).treegrid('find', id)){
|
||||
removeMethod.call($.fn.treegrid.methods, $(this), id);
|
||||
}
|
||||
var state = $(this).data('treegrid');
|
||||
if (state.options.loadFilter == pagerFilter){
|
||||
for(var i=0; i<state.allRows.length; i++){
|
||||
if (state.allRows[i][state.options.idField] == id){
|
||||
state.allRows.splice(i,1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$(this).treegrid('loadData', state.allRows);
|
||||
}
|
||||
})
|
||||
},
|
||||
getAllRows: function(jq){
|
||||
return jq.data('treegrid').allRows;
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
function formatProgress(value){
|
||||
if (value){
|
||||
var s = '<div style="width:100%;border:1px solid #ccc">' +
|
||||
'<div style="width:' + value + '%;background:#cc0000;color:#fff">' + value + '%' + '</div>'
|
||||
'</div>';
|
||||
return s;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$('#tg').treegrid().treegrid('clientPaging');
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
106
erp_web/js/easyui/demo/treegrid/contextmenu.html
Normal file
106
erp_web/js/easyui/demo/treegrid/contextmenu.html
Normal file
@@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>TreeGrid ContextMenu - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>TreeGrid ContextMenu</h2>
|
||||
<p>Right click to display the context menu.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table id="tg" class="easyui-treegrid" title="TreeGrid ContextMenu" style="width:700px;height:250px"
|
||||
data-options="
|
||||
iconCls: 'icon-ok',
|
||||
rownumbers: true,
|
||||
animate: true,
|
||||
collapsible: true,
|
||||
fitColumns: true,
|
||||
url: 'treegrid_data2.json',
|
||||
method: 'get',
|
||||
idField: 'id',
|
||||
treeField: 'name',
|
||||
onContextMenu: onContextMenu
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name',width:180">Task Name</th>
|
||||
<th data-options="field:'persons',width:60,align:'right'">Persons</th>
|
||||
<th data-options="field:'begin',width:80">Begin Date</th>
|
||||
<th data-options="field:'end',width:80">End Date</th>
|
||||
<th data-options="field:'progress',width:120,formatter:formatProgress">Progress</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div id="mm" class="easyui-menu" style="width:120px;">
|
||||
<div onclick="append()" data-options="iconCls:'icon-add'">Append</div>
|
||||
<div onclick="removeIt()" data-options="iconCls:'icon-remove'">Remove</div>
|
||||
<div class="menu-sep"></div>
|
||||
<div onclick="collapse()">Collapse</div>
|
||||
<div onclick="expand()">Expand</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function formatProgress(value){
|
||||
if (value){
|
||||
var s = '<div style="width:100%;border:1px solid #ccc">' +
|
||||
'<div style="width:' + value + '%;background:#cc0000;color:#fff">' + value + '%' + '</div>'
|
||||
'</div>';
|
||||
return s;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
function onContextMenu(e,row){
|
||||
if (row){
|
||||
e.preventDefault();
|
||||
$(this).treegrid('select', row.id);
|
||||
$('#mm').menu('show',{
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}
|
||||
}
|
||||
var idIndex = 100;
|
||||
function append(){
|
||||
idIndex++;
|
||||
var d1 = new Date();
|
||||
var d2 = new Date();
|
||||
d2.setMonth(d2.getMonth()+1);
|
||||
var node = $('#tg').treegrid('getSelected');
|
||||
$('#tg').treegrid('append',{
|
||||
parent: node.id,
|
||||
data: [{
|
||||
id: idIndex,
|
||||
name: 'New Task'+idIndex,
|
||||
persons: parseInt(Math.random()*10),
|
||||
begin: $.fn.datebox.defaults.formatter(d1),
|
||||
end: $.fn.datebox.defaults.formatter(d2),
|
||||
progress: parseInt(Math.random()*100)
|
||||
}]
|
||||
})
|
||||
}
|
||||
function removeIt(){
|
||||
var node = $('#tg').treegrid('getSelected');
|
||||
if (node){
|
||||
$('#tg').treegrid('remove', node.id);
|
||||
}
|
||||
}
|
||||
function collapse(){
|
||||
var node = $('#tg').treegrid('getSelected');
|
||||
if (node){
|
||||
$('#tg').treegrid('collapse', node.id);
|
||||
}
|
||||
}
|
||||
function expand(){
|
||||
var node = $('#tg').treegrid('getSelected');
|
||||
if (node){
|
||||
$('#tg').treegrid('expand', node.id);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
40
erp_web/js/easyui/demo/treegrid/customcheckbox.html
Normal file
40
erp_web/js/easyui/demo/treegrid/customcheckbox.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Custom CheckBox in TreeGrid - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Custom CheckBox in TreeGrid</h2>
|
||||
<p>TreeGrid nodes with customized check boxes.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table title="Folder Browser" class="easyui-treegrid" style="width:700px;height:250px"
|
||||
data-options="
|
||||
url: 'treegrid_data1.json',
|
||||
method: 'get',
|
||||
rownumbers: true,
|
||||
idField: 'id',
|
||||
treeField: 'name',
|
||||
checkbox: function(row){
|
||||
var names = ['Java','eclipse.exe','eclipse.ini'];
|
||||
if ($.inArray(row.name, names)>=0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name'" width="220">Name</th>
|
||||
<th data-options="field:'size'" width="100" align="right">Size</th>
|
||||
<th data-options="field:'date'" width="150">Modified Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
93
erp_web/js/easyui/demo/treegrid/editable.html
Normal file
93
erp_web/js/easyui/demo/treegrid/editable.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Editable TreeGrid - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Editable TreeGrid</h2>
|
||||
<p>Select one node and click edit button to perform editing.</p>
|
||||
<div style="margin:20px 0;">
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="edit()">Edit</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="save()">Save</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="cancel()">Cancel</a>
|
||||
</div>
|
||||
<table id="tg" class="easyui-treegrid" title="Editable TreeGrid" style="width:700px;height:250px"
|
||||
data-options="
|
||||
iconCls: 'icon-ok',
|
||||
rownumbers: true,
|
||||
animate: true,
|
||||
collapsible: true,
|
||||
fitColumns: true,
|
||||
url: 'treegrid_data2.json',
|
||||
method: 'get',
|
||||
idField: 'id',
|
||||
treeField: 'name',
|
||||
showFooter: true
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name',width:180,editor:'text'">Task Name</th>
|
||||
<th data-options="field:'persons',width:60,align:'right',editor:'numberbox'">Persons</th>
|
||||
<th data-options="field:'begin',width:80,editor:'datebox'">Begin Date</th>
|
||||
<th data-options="field:'end',width:80,editor:'datebox'">End Date</th>
|
||||
<th data-options="field:'progress',width:120,formatter:formatProgress,editor:'numberbox'">Progress</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
function formatProgress(value){
|
||||
if (value){
|
||||
var s = '<div style="width:100%;border:1px solid #ccc">' +
|
||||
'<div style="width:' + value + '%;background:#cc0000;color:#fff">' + value + '%' + '</div>'
|
||||
'</div>';
|
||||
return s;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
var editingId;
|
||||
function edit(){
|
||||
if (editingId != undefined){
|
||||
$('#tg').treegrid('select', editingId);
|
||||
return;
|
||||
}
|
||||
var row = $('#tg').treegrid('getSelected');
|
||||
if (row){
|
||||
editingId = row.id
|
||||
$('#tg').treegrid('beginEdit', editingId);
|
||||
}
|
||||
}
|
||||
function save(){
|
||||
if (editingId != undefined){
|
||||
var t = $('#tg');
|
||||
t.treegrid('endEdit', editingId);
|
||||
editingId = undefined;
|
||||
var persons = 0;
|
||||
var rows = t.treegrid('getChildren');
|
||||
for(var i=0; i<rows.length; i++){
|
||||
var p = parseInt(rows[i].persons);
|
||||
if (!isNaN(p)){
|
||||
persons += p;
|
||||
}
|
||||
}
|
||||
var frow = t.treegrid('getFooterRows')[0];
|
||||
frow.persons = persons;
|
||||
t.treegrid('reloadFooter');
|
||||
}
|
||||
}
|
||||
function cancel(){
|
||||
if (editingId != undefined){
|
||||
$('#tg').treegrid('cancelEdit', editingId);
|
||||
editingId = undefined;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
33
erp_web/js/easyui/demo/treegrid/fluid.html
Normal file
33
erp_web/js/easyui/demo/treegrid/fluid.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Fluid TreeGrid - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Fluid TreeGrid</h2>
|
||||
<p>This example shows how to assign percentage width to a column in TreeGrid.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table title="Fluid Browser" class="easyui-treegrid" style="width:700px;height:250px"
|
||||
data-options="
|
||||
url: 'treegrid_data1.json',
|
||||
method: 'get',
|
||||
idField: 'id',
|
||||
treeField: 'name'
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name'" width="50%">Name(50%)</th>
|
||||
<th data-options="field:'size'" width="20%" align="right">Size(20%)</th>
|
||||
<th data-options="field:'date'" width="30%">Modified Date(30%)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
55
erp_web/js/easyui/demo/treegrid/footer.html
Normal file
55
erp_web/js/easyui/demo/treegrid/footer.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>TreeGrid with Footer - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>TreeGrid with Footer</h2>
|
||||
<p>Show summary information on TreeGrid footer.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table id="tg"></table>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#tg').treegrid({
|
||||
title:'TreeGrid with Footer',
|
||||
iconCls:'icon-ok',
|
||||
width:700,
|
||||
height:250,
|
||||
rownumbers: true,
|
||||
animate:true,
|
||||
collapsible:true,
|
||||
fitColumns:true,
|
||||
url:'treegrid_data2.json',
|
||||
method: 'get',
|
||||
idField:'id',
|
||||
treeField:'name',
|
||||
showFooter:true,
|
||||
columns:[[
|
||||
{title:'Task Name',field:'name',width:180},
|
||||
{field:'persons',title:'Persons',width:60,align:'right'},
|
||||
{field:'begin',title:'Begin Date',width:80},
|
||||
{field:'end',title:'End Date',width:80},
|
||||
{field:'progress',title:'Progress',width:120,
|
||||
formatter:function(value){
|
||||
if (value){
|
||||
var s = '<div style="width:100%;border:1px solid #ccc">' +
|
||||
'<div style="width:' + value + '%;background:#cc0000;color:#fff">' + value + '%' + '</div>'
|
||||
'</div>';
|
||||
return s;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
]]
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
35
erp_web/js/easyui/demo/treegrid/lines.html
Normal file
35
erp_web/js/easyui/demo/treegrid/lines.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>TreeGrid Lines - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>TreeGrid Lines</h2>
|
||||
<p>This example shows how to show treegrid lines.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table title="TreeGrid Lines" class="easyui-treegrid" style="width:700px;height:250px"
|
||||
data-options="
|
||||
url: 'treegrid_data1.json',
|
||||
method: 'get',
|
||||
lines: true,
|
||||
rownumbers: true,
|
||||
idField: 'id',
|
||||
treeField: 'name'
|
||||
">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'name'" width="220">Name</th>
|
||||
<th data-options="field:'size'" width="100" align="right">Size</th>
|
||||
<th data-options="field:'date'" width="150">Modified Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
49
erp_web/js/easyui/demo/treegrid/reports.html
Normal file
49
erp_web/js/easyui/demo/treegrid/reports.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Reports using TreeGrid - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Reports using TreeGrid</h2>
|
||||
<p>Using TreeGrid to show complex reports.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<table title="Reports using TreeGrid" class="easyui-treegrid" style="width:700px;height:250px"
|
||||
data-options="
|
||||
url: 'treegrid_data3.json',
|
||||
method: 'get',
|
||||
rownumbers: true,
|
||||
showFooter: true,
|
||||
idField: 'id',
|
||||
treeField: 'region'
|
||||
">
|
||||
<thead frozen="true">
|
||||
<tr>
|
||||
<th field="region" width="200">Region</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">2009</th>
|
||||
<th colspan="4">2010</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th field="f1" width="60" align="right">1st qrt.</th>
|
||||
<th field="f2" width="60" align="right">2st qrt.</th>
|
||||
<th field="f3" width="60" align="right">3st qrt.</th>
|
||||
<th field="f4" width="60" align="right">4st qrt.</th>
|
||||
<th field="f5" width="60" align="right">1st qrt.</th>
|
||||
<th field="f6" width="60" align="right">2st qrt.</th>
|
||||
<th field="f7" width="60" align="right">3st qrt.</th>
|
||||
<th field="f8" width="60" align="right">4st qrt.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
73
erp_web/js/easyui/demo/treegrid/treegrid_data1.json
Normal file
73
erp_web/js/easyui/demo/treegrid/treegrid_data1.json
Normal file
@@ -0,0 +1,73 @@
|
||||
[{
|
||||
"id":1,
|
||||
"name":"C",
|
||||
"size":"",
|
||||
"date":"02/19/2010",
|
||||
"children":[{
|
||||
"id":2,
|
||||
"name":"Program Files",
|
||||
"size":"120 MB",
|
||||
"date":"03/20/2010",
|
||||
"children":[{
|
||||
"id":21,
|
||||
"name":"Java",
|
||||
"size":"",
|
||||
"date":"01/13/2010",
|
||||
"state":"closed",
|
||||
"children":[{
|
||||
"id":211,
|
||||
"name":"java.exe",
|
||||
"size":"142 KB",
|
||||
"date":"01/13/2010"
|
||||
},{
|
||||
"id":212,
|
||||
"name":"jawt.dll",
|
||||
"size":"5 KB",
|
||||
"date":"01/13/2010"
|
||||
}]
|
||||
},{
|
||||
"id":22,
|
||||
"name":"MySQL",
|
||||
"size":"",
|
||||
"date":"01/13/2010",
|
||||
"state":"closed",
|
||||
"children":[{
|
||||
"id":221,
|
||||
"name":"my.ini",
|
||||
"size":"10 KB",
|
||||
"date":"02/26/2009"
|
||||
},{
|
||||
"id":222,
|
||||
"name":"my-huge.ini",
|
||||
"size":"5 KB",
|
||||
"date":"02/26/2009"
|
||||
},{
|
||||
"id":223,
|
||||
"name":"my-large.ini",
|
||||
"size":"5 KB",
|
||||
"date":"02/26/2009"
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
"id":3,
|
||||
"name":"eclipse",
|
||||
"size":"",
|
||||
"date":"01/20/2010",
|
||||
"children":[{
|
||||
"id":31,
|
||||
"name":"eclipse.exe",
|
||||
"size":"56 KB",
|
||||
"date":"05/19/2009"
|
||||
},{
|
||||
"id":32,
|
||||
"name":"eclipse.ini",
|
||||
"size":"1 KB",
|
||||
"date":"04/20/2010"
|
||||
},{
|
||||
"id":33,
|
||||
"name":"notice.html",
|
||||
"size":"7 KB",
|
||||
"date":"03/17/2005"
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
11
erp_web/js/easyui/demo/treegrid/treegrid_data2.json
Normal file
11
erp_web/js/easyui/demo/treegrid/treegrid_data2.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{"total":7,"rows":[
|
||||
{"id":1,"name":"All Tasks","begin":"3/4/2010","end":"3/20/2010","progress":60,"iconCls":"icon-ok"},
|
||||
{"id":2,"name":"Designing","begin":"3/4/2010","end":"3/10/2010","progress":100,"_parentId":1,"state":"closed"},
|
||||
{"id":21,"name":"Database","persons":2,"begin":"3/4/2010","end":"3/6/2010","progress":100,"_parentId":2},
|
||||
{"id":22,"name":"UML","persons":1,"begin":"3/7/2010","end":"3/8/2010","progress":100,"_parentId":2},
|
||||
{"id":23,"name":"Export Document","persons":1,"begin":"3/9/2010","end":"3/10/2010","progress":100,"_parentId":2},
|
||||
{"id":3,"name":"Coding","persons":2,"begin":"3/11/2010","end":"3/18/2010","progress":80},
|
||||
{"id":4,"name":"Testing","persons":1,"begin":"3/19/2010","end":"3/20/2010","progress":20}
|
||||
],"footer":[
|
||||
{"name":"Total Persons:","persons":7,"iconCls":"icon-sum"}
|
||||
]}
|
||||
13
erp_web/js/easyui/demo/treegrid/treegrid_data3.json
Normal file
13
erp_web/js/easyui/demo/treegrid/treegrid_data3.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{"total":9,"rows":[
|
||||
{"id":1,"region":"Wyoming"},
|
||||
{"id":11,"region":"Albin","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1},
|
||||
{"id":12,"region":"Canon","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1},
|
||||
{"id":13,"region":"Egbert","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1},
|
||||
{"id":2,"region":"Washington"},
|
||||
{"id":21,"region":"Bellingham","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2},
|
||||
{"id":22,"region":"Chehalis","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2},
|
||||
{"id":23,"region":"Ellensburg","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2},
|
||||
{"id":24,"region":"Monroe","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2}
|
||||
],"footer":[
|
||||
{"region":"Total","f1":14000,"f2":12600,"f3":13321,"f4":15281,"f5":14931,"f6":13461,"f7":14126,"f8":12866}
|
||||
]}
|
||||
Reference in New Issue
Block a user