liuyg
2021-07-02 25ce610f6ecca7325e7a743dc032c4a76559c63d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Test Column Resizer with Complex Columns</title>
        <meta name="viewport" content="width=570">
        <style>
            @import "../../../dojo/resources/dojo.css";
            @import "../../css/dgrid.css";
            @import "../../css/skins/claro.css";
            .heading {
                font-weight: bold;
                padding-bottom: 0.25em;
            }
            .grid {
                width: 700px;
            }
            .grid .dgrid-column-set-0 {
                width: 50%;
            }
            .grid .field-col1 {
                width: 100px;
            }
            .grid .field-col2 {
                width: 100px;
            }
            .grid .field-col4 {
                width: 500px;
            }
            .dgrid {
                margin: 10px;
            }
        </style>
 
        <script src="../../../dojo/dojo.js"
            data-dojo-config="async: true"></script>
        <script>
            require(["dgrid/OnDemandGrid", "dgrid/ColumnSet", "dgrid/Selection", "dgrid/Keyboard", "dgrid/extensions/ColumnResizer", "dojo/_base/declare", "dgrid/test/data/testStore", "dojo/domReady!"],
                function(Grid, ColumnSet, Selection, Keyboard, ColumnResizer, declare, testStore){
                    window.grid = new (declare([Grid, ColumnSet, Selection, Keyboard, ColumnResizer]))({
                        collection: testStore,
                        columnSets: [
                            [
                                [{label: 'Column 1', field: 'col1'},
                                        {label: 'Column 2', field: 'col2', sortable: false}],
                                    [{label: 'Column 3', field: 'col3', colSpan: 2}]],
                            [
                                [{label: 'Column 1', field: 'col1', rowSpan: 2},
                                    {label: 'Column 4', field: 'col4'}],
                                    [{label: 'Column 5', field: 'col5'}]]]
                    }, "grid");
                    // same structure as above, without being split into ColumnSets
                    window.gridNoColumnSets = new (declare([Grid, Selection, Keyboard, ColumnResizer]))({
                        collection: testStore,
                        subRows: [[
                            {label: 'Column 1', field: 'col1'},
                            {label: 'Column 2', field: 'col2', sortable: false},
                            {label: 'Column 1', field: 'col1', rowSpan: 2},
                            {label: 'Column 4', field: 'col4'}
                        ], [
                            {label: 'Column 3', field: 'col3', colSpan: 2, rowSpan: 2},
                            {label: 'Column 5', field: 'col5'}
                        ], [
                            {label: 'Column 2', field: 'col5'},
                            {label: 'Column 1', field: 'col1'}
                        ]]
                    }, "gridNoColumnSets");
            });
        </script>
    </head>
    <body class="claro">
        <h2>A resize Grid with complex columns including locking columns and subrows</h2>
        <div id="grid" class="grid"></div>
        <h2>A resize Grid with complex columns including subrows, no ColumnSets</h2>
        <div id="gridNoColumnSets" class="grid"></div>
    </body>
</html>