Compare commits
2 Commits
29d693dfae
...
85c02fd2f3
Author | SHA1 | Date |
---|---|---|
wangxinglong | 85c02fd2f3 | |
wangxinglong | 7b4eed29e5 |
|
@ -34,6 +34,7 @@ layui.use(['laytpl', 'treeTable', 'jquery', 'iconPickerFa', 'form', 'miniTab', '
|
|||
{type: 'checkbox'},
|
||||
{field: 'name', title: '名称', minWidth: 150, singleLine: true},
|
||||
{field: 'name', title: '状态'},
|
||||
{field: 'sort', title: '排序',edit:"text"},
|
||||
{templet: '#row-status',field: 'status', minWidth: 180,align: 'center', title: '状态'},
|
||||
]],
|
||||
done: function () {
|
||||
|
@ -53,6 +54,23 @@ layui.use(['laytpl', 'treeTable', 'jquery', 'iconPickerFa', 'form', 'miniTab', '
|
|||
}
|
||||
})
|
||||
});
|
||||
let sort = $('#table-container-sort').data('url');
|
||||
treeTable.on('edit(menu-table)', function (obj) {
|
||||
let id = obj.data.id;
|
||||
if (obj.field == 'sort') {
|
||||
$.ajax(sort, {
|
||||
data: {
|
||||
"sort": obj.value,
|
||||
"id": id
|
||||
}
|
||||
,dataType : 'json'
|
||||
,type: 'POST'
|
||||
})
|
||||
.done(function () {
|
||||
insTb.reload();
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
//监听工具条 注意区别toolbar和tool toolbar是表头上的工具条 tool是行中的工具条
|
||||
treeTable.on('toolbar(menu-table)', function (obj) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<!-- 编辑单元格提交url -->
|
||||
<input type="hidden" id="row-modify" data-url="/manager/area/modify">
|
||||
|
||||
|
||||
<div id="table-container-sort" data-url="/manager/area/sort" ></div>
|
||||
<!-- 列-状态变更 -->
|
||||
<script type="text/html" id="row-status">
|
||||
<input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="正常|禁用" lay-filter="changeStatus" {{ d.status == 1 ? 'checked' : '' }}>
|
||||
|
|
Loading…
Reference in New Issue