官网示例
1先有一个table 加一个模版 查看,加一个event 事件 ,点击时跳到事件处理那
,{field:'', title:'sss记录',event: 'xxx',align: 'center', templet: function (d) { if(d.fn_IsValid == 1){ res = "查看" }else{ res = "无" } return res; } }
2:事件
//监听工具条 table.on('tool(tabledemo)', function(obj){ var data = obj.data; if(obj.event === 'xxx'){ //查看还款记录 layer.open({ type: 2, shadeClose: true, shade: 0.8, /* area: ['380px', '90%'],*/ area: ['1000px', '1000px'], content: '/manage/ssskjl.aspx?id='+data.id }); } layer.open({ type: 2, //type=2 是iframe 方式 shadeClose: true, shade: 0.8, /* area: ['380px', '90%'],*/ area: ['1100px', '1100px'], content: '/manage/show.aspx?id='+data.id+'&&flag='+flag, //内容是要访问的页面地址,在此是有参数传入 }); } });
3: 设计展示的界面, 这个界面 是展示内容的界面.