网格无法使用dojotoolkit

时间:2013-09-03 06:03:23

标签: javascript

新的dojo工作,没有显示任何网格...请回复我试过这个....

require([ "dgrid/Grid", "dojo/domReady!" ], function(Grid) {
        var data = [ {
            first : "Bob",
            last : "Barker",
            age : 89
        }, {
            first : "Vanna",
            last : "White",
            age : 55
        }, {
            first : "Pat",
            last : "Sajak",
            age : 65
        } ];

        var grid = new Grid({
            columns : {
                first : "First Name",
                last : "Last Name",
                age : "Age"
            }
        }, "grid");
        grid.renderArray(data);
    });

我也尝试了这个


!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">




    require([ "dojox/grid/DataGrid", "dojo/domReady!" ], function(DataGrid) {

        var data = [ {
            first : "A101",
            second : "A11",
            third : "B11"
        }, {
            first : "A102",
            second : "A12",
            third : "B12"
        }, {
            first : "A103",
            second : "A13",
            third : "B13"
        } ];
var grid = new DataGrid({
            store : store,
            query : {
                id : "*"
            },
            structure : [ {
                name : "EmployId",
                field : "first",
                width : "30px"
            }, {
                name : "FirstName",
                field : "second",
                width : "30px"
            }, {
                name : "LastName",
                field : "third",
                width : "20px"
            },

            ]
        }, "grid");
        grid.renderArray(data);

        grid.startup();


    });

 

0 个答案:

没有答案