Ticket #6084: gridSort.html

File gridSort.html, 2.2 kB (added by guest, 10 months ago)

Simple example demonstrating sorting problems with nulls in columns

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html">
5    <script type="text/javascript" src="/js/dojo102/dojo/dojo.js" djConfig="parseOnLoad: true, isDebug: true"></script>
6    <script type="text/javascript">
7        dojo.require("dojo.parser");
8        dojo.require("dojox.grid.Grid");
9        dojo.require("dijit.layout.TabContainer");
10        dojo.require("dijit.layout.ContentPane");
11        dojo.require("dojox.grid._data.model");
12        var colsView = {
13                cells: [[
14                { name: 'Data in all cells', field: 'all' },
15                { name: 'Nulls in some cells', field: 'nulls' },
16                { name: 'Empty strings in some cells', field: 'empty' },
17                { name: 'nbsp in some cells', field: 'nbsp' },
18                { name: 'Missing field in some cells', field: 'missing' },
19                { name: 'Another complete set', field: 'complete' }
20                ]]
21        };
22        var layout = [ colsView ];
23        var data = [
24        {
25                all: 1,
26                nulls: null,
27                empty: "a",
28                nbsp: "a",
29                missing: "z",
30                complete: "present"
31        },
32        {
33                all: 2,
34                nulls: "not null",
35                empty: "",
36                nbsp: "b",
37                missing: "y",
38                complete: "present"
39        },
40        {
41                all: 3,
42                nulls: "string",
43                empty: "c",
44                nbsp: "&nbsp;",
45                complete: "missing"
46        },
47        {
48                all: 4,
49                nulls: null,
50                empty: "d",
51                nbsp: "d",
52                missing: "w",
53                complete: "present"
54        },
55        {
56                all: 5,
57                nulls: "data",
58                empty: "e",
59                nbsp: "&nbsp;",
60                complete: "missing"
61        },
62        {
63                all: 6,
64                nulls: null,
65                empty: "",
66                nbsp: "f",
67                missing: "u",
68                complete: "present"
69        }];
70        dojo.addOnLoad(
71                function ()
72                {
73                        scrollGrid.setStructure(layout);
74                        var scrollModel = new dojox.grid.data.Objects(null, data);
75                        scrollGrid.setModel(scrollModel);
76                        scrollGrid.refresh();
77                }
78                );
79    </script>
80    <style type="text/css">
81        @import "/js/dojo102/dojo/resources/dojo.css";
82        @import "/js/dojo102/dijit/themes/tundra/tundra.css";
83        @import "/js/dojo102/dojox/grid/_grid/tundraGrid.css";
84html, body, #divScrollGrid {
85    width: 100%; height: 100%;
86    border: 0; padding: 0; margin: 0;
87 }
88    </style>
89</head>
90<body class="tundra">
91<div dojoType="dojox.Grid" id="divScrollGrid" jsId="scrollGrid"></div>
92</div>
93</body>
94</html>