You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
如题,请问默认不把data传到edit页面吗?怎么在edit页拿到data数据?
想到了这个解决办法,请问原始有简便的方法没?
// 对所选编辑行数据编码
var data = escape(JSON.stringify(obj.data));
if (obj.event === 'edit') {
var index = layer.open({
title: '编辑用户',
type: 2,
content: './table/user-edit.html?'+data,
// 编辑页解码,得到原始对象
console.log(JSON.parse(unescape(location.search).replace('?','')))
The text was updated successfully, but these errors were encountered:
你试试这个
var dataJson;
layui.use('table', function(){
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
// 给dataJson 赋值
var data = JSON.stringify(data);
var index = layer.open({
title: '编辑用户',
type: 2,
content: './table/user-edit.html',
})
// 然后在编辑页获取dataJson
获取dataJson = eval ('('+parent.dataJson+')');
这个应该可以
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
如题,请问默认不把data传到edit页面吗?怎么在edit页拿到data数据?
想到了这个解决办法,请问原始有简便的方法没?
// 对所选编辑行数据编码
var data = escape(JSON.stringify(obj.data));
if (obj.event === 'edit') {
var index = layer.open({
title: '编辑用户',
type: 2,
content: './table/user-edit.html?'+data,
// 编辑页解码,得到原始对象
console.log(JSON.parse(unescape(location.search).replace('?','')))
The text was updated successfully, but these errors were encountered: