2017-03-16 50 views
0

我想使網頁上顯示的一些數據w2ui網格。但如果我使用jQuery 3.1.1網格呈現和顯示,但沒有顯示記錄(重新加載按鈕使它們出現,但這不是一個解決方案)。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> 

回答

0

這似乎與w2ui 1.5 RC1(小提琴:http://jsfiddle.net/0gvujdm3/1/)的問題

如果更新源的最新w2ui 1.5(夜間主),你會看到這個問題不再出現(小提琴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顏色選擇器輸入在夜間主破裂(但作品在1.5 rc1罰款)。