//Datatables import win.ui; /*DSG{{*/ var winform = win.form(text="强大的表格组件: Datatables ( 兼容 Win XP/IE6 )";right=1063;bottom=729) winform.add( button={cls="button";text="aardio 修改数据";left=832;top=683;right=990;bottom=723;db=1;dr=1;z=2}; lbBrowser={cls="static";left=15;top=8;right=1053;bottom=680;db=1;dl=1;dr=1;dt=1;transparent=1;z=1}; static={cls="static";text="可单击编辑姓名、状态值";left=353;top=698;right=778;bottom=726;align="right";db=1;dl=1;dr=1;font=LOGFONT(h=-13);transparent=1;z=3} ) /*}}*/ import web.form; var wb = web.form(winform.lbBrowser); import JSON; wb.external = { getData = function(){ var data = { { "id": "001", "name": "张三(点这里)", "status": "在线", "birthday": "2000-12-31" }, { "id": "002", "name": "李四", "status": "离线", "birthday": "2000-11-31" } } /* 转换为纯 JS 对象。 只有 web.form 控件里才需要使用 wb.jsObject 以解决 IE 内核的 JSON 兼容问题。 web.view 控件里则可以直接返回 JSON.stringify(data) 并在网页中使用 JSON.parse(result) 转换为 JS 对象。 web.view 控件用 wb.export 导出的本地 aardio 函数则会自动使用 JSON 转换参数与返回值。 */ return wb.jsObject(data,true); }; } winform.button.oncommand = function(id,event){ wb.script.reloadData(JSON.stringifyArray({ { "id": "001", "name": "李一二三", "status": "离线", "birthday": "1990-12-31" }, { "id": "002", "name": "张四五六", "status": "在线", "birthday": "1990-11-31" } })); } /* 实际开发建议到 https://datatables.net/download/ 下载 JS,CSS 到本地。 更多官方范例请参考: https://datatables.net/examples/ 中文文档请参考: https://datatables.club 注意 Win10/11 自带 IE11, Win7 已逐渐退出市场一般没必要再考虑 */ wb.html = /**
| 编号 | 姓名 | 状态 | 出生日期 |
|---|