尝试解决树型字典

This commit is contained in:
caoqianming 2021-01-10 22:04:09 +08:00
parent e834c617ef
commit 42dc36da06
2 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@
</div>
</div>
<script>
$('#dictable').datagrid({
$('#dictable').treegrid({
rownumbers: true,
singleSelect: true,
striped: true,
@ -59,7 +59,7 @@
onClick: function (node) {
//是叶子节点则打开或跳转到tab页。
if ($('#dicclasstree').tree('isLeaf', node.target)) {
$("#dictable").datagrid({
$("#dictable").treegrid({
url: 'getdickey?dicclass=' + node.id + '&a=datagrid',
});
$("#dictable").attr('name', node.id);
@ -107,7 +107,7 @@
//ajax接收的才是js对象
function deldict() {
var row = $('#dictable').datagrid('getSelected');
var row = $('#dictable').treegrid('getSelected');
if (row) {
$.messager.confirm('提示', '确定删除吗?', function (r) {
if (r) {
@ -118,7 +118,7 @@
beforeSend: function () { },
success: function (data) {
if (data.code == 1) {
$("#dictable").datagrid('reload');
$("#dictable").treegrid('reload');
} else {
$.messager.alert('提示', '您无权删除!');
}
@ -141,7 +141,7 @@
}
}
function editdict() {
var row = $('#dictable').datagrid('getSelected');
var row = $('#dictable').treegrid('getSelected');
if (row) {
$.ajax({
type: "GET",

Binary file not shown.