123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link rel="stylesheet" type="text/css" href="../css/gm.css">
- <script type="text/javascript" src="../js/gm.js"></script>
- <title>GridManager:多表I18N</title>
- <link rel="stylesheet" type="text/css" href="./css/common.css">
- </head>
- <body>
- <script type="text/javascript">
- const createTable = (title, arg) => {
- const h3 = document.createElement('h3');
- h3.innerText = title;
- document.body.appendChild(h3);
- const div = document.createElement('div');
- const table = document.createElement('table');
- div.appendChild(table);
- document.body.appendChild(div);
- new GridManager(table, arg);
- };
- createTable('简体中文: { i18n: "zh-cn" }', {
- height: '300px',
- gridManagerName: 'test1',
- supportAjaxPage:true,
- ajaxData: 'https://www.lovejavascript.com/learnLinkManager/getLearnLinkList',
- ajaxType: 'POST',
- query: {tableName: 'test1', ccname: 'baukh'},
- pageSize:10,
- columnData: [
- {
- key: 'name',
- remind: '网站标题',
- width: '100px',
- text: '标题',
- sorting: 'up'
- },{
- key: 'info',
- remind: '网站介绍',
- text: '介绍',
- sorting: ''
- },{
- key: 'url',
- remind: '网站地址',
- text: '地址'
- }
- ]
- });
- createTable('English: { i18n: "en-us" }', {
- height: '400px',
- gridManagerName: 'test2',
- i18n: 'en-us',
- ajaxData: 'https://www.lovejavascript.com/learnLinkManager/getLearnLinkList',
- ajaxType: 'POST',
- query: {tableName: 'test2', 'love': 'kouzi'},
- pageSize:20,
- supportAjaxPage:true,
- columnData: [
- {
- key: 'name',
- remind: 'the name',
- width: '100px',
- text: 'name',
- sorting: 'DESC'
- },{
- key: 'info',
- remind: 'the info',
- text: 'info',
- sorting: ''
- },{
- key: 'url',
- remind: 'the url',
- text: 'url'
- }
- ]
- });
- createTable('繁體中文: { i18n: "zh-tw" }', {
- height: '300px',
- gridManagerName: 'test3',
- i18n: 'zh-tw',
- ajaxData: 'https://www.lovejavascript.com/learnLinkManager/getLearnLinkList',
- ajaxType: 'POST',
- query: {tableName: 'test3', baby: 'kouzi'},
- pageSize:30,
- supportAjaxPage:true,
- columnData: [
- {
- key: 'name',
- remind: '網站名稱',
- width: '100px',
- text: '名稱',
- sorting: 'DESC'
- },{
- key: 'info',
- remind: '網站介紹',
- text: '介紹',
- sorting: ''
- },{
- key: 'url',
- remind: '網站地址',
- text: '地址'
- }
- ]
- });
- </script>
- </body>
- </html>
|