【问题标题】:w2ui with jquery 3.1.1 grid not showing recordsw2ui 与 jquery 3.1.1 网格不显示记录
【发布时间】:2017-08-07 07:43:18
【问题描述】:

我正在尝试制作 w2ui 网格,其中包含一些数据显示在页面上。但是如果我使用 jquery 3.1.1 渲染并显示网格,但不显示记录(重新加载按钮使它们出现,但这不是解决方案)。

我的代码:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"/>
  <script src="w2ui/jquery-3.1.1.js"></script>
  <script type="text/javascript" src="w2ui/w2ui-1.5.rc1.js"></script>
  <link rel="stylesheet" type="text/css" href="w2ui/w2ui-1.5.rc1.css" />
</head>
<body>
  <div id="main" style="width:98vw; height: 98vh;  margin:0 auto"></div>
  <script type="text/javascript">
  var grid2 = {
    grid: {
      name: 'grid',
      selectType: 'cell',
      style:'font-size:xx-small',
      show: {
        toolbar: true,
        footer: true,
      },
      columns: [
        {field:'code', caption:'Code', size:'5%', resizable: false},
        {field:'name', caption:'Name', size:'20%', resizable: false},
        {field:'f1', caption:'Field1', size:'5.35%', resizable: false}
      ],
      records:[
        {recid: 0, code: '34072', name: 'Name1'},
        {recid: 1, code: '00372', name: 'Name2'},
        {recid: 2, code: '30402', name: 'Name3'},
      ]
    }
  };
  $(document).ready(
    function () {
      //w2utils.locale('w2ui/locale/ru-ru.json');
      $('#main').w2grid(grid2.grid);
    }
  );
</script>
</body>
</html>

【问题讨论】:

    标签: jquery w2ui


    【解决方案1】:

    这似乎是 w2ui 1.5 rc1 的问题(小提琴:http://jsfiddle.net/0gvujdm3/1/

    如果你更新源码到最新的w2ui 1.5(nightly master),你会看到这个问题不再出现(fiddle http://jsfiddle.net/0gvujdm3/

    Since I can't post fiddle links w/o also posting code, 
    here's some extra content to this answer.
    

    注意:目前 w2ui 颜色选择器输入在 nightly master 中已损坏(但在 1.5 rc1 中工作正常)。

    【讨论】:

      猜你喜欢
      • 2018-10-28
      • 1970-01-01
      • 2014-02-13
      • 2012-05-24
      • 2015-10-18
      • 2018-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多