Skip to content
Browse files

Working on legacy test

  • Loading branch information...
1 parent 871b5ef commit 5fafdfdf5e14c4ef9257c0e654316e4fac7fc1fd @kriszyp committed Aug 30, 2011
Showing with 26 additions and 21 deletions.
  1. +26 −21 test/test_legacy.html
View
47 test/test_legacy.html
@@ -8,12 +8,12 @@
<style type="text/css">
@import "../../dojo/resources/dojo.css";
@import "../css/skins/claro.css";
+ @import "../css/dgrid.css";
body {
padding: 0 80px; /* side padding to make it easier to scroll doc */
}
</style>
- <script type="text/javascript" src="../../dojo/dojo.js"
- data-dojo-config="async: true"></script>
+ <script type="text/javascript" src="../../dojo/dojo.js"></script>
<script type="text/javascript">
var store; // defined later, Memory store containing data
@@ -71,47 +71,52 @@
name: {},
description: {name: "what to do", sortable: false}
};
- require(["dgrid/Grid", "dgrid/OnDemandGrid", "dgrid/GridFromHtml", "dojo/store/Memory", "dojo/store/Observable", "dojo/_base/declare", "dojo/parser", "dojo/query", "dgrid/test/test_data", "dojo/domReady!"],
- function(Grid, OnDemandGrid, GridFromHtml, Memory, Observable, declare, parser, query){
-
+ dojo.require("dgrid.Grid");
+ dojo.require("dgrid.OnDemandGrid");
+ dojo.require("dgrid.GridFromHtml");
+ dojo.require("dojo.store.Memory");
+ dojo.require("dojo.store.Observable");
+ dojo.require("dojo.parser");
+ dojo.require("dgrid.test.test_data");
+ dojo.ready(function(){
// fully-programmatic tests
- window.gridLegacyFormatter = new Grid({
+ window.gridLegacyFormatter = new dgrid.Grid({
columns: columnsLegacyFormatter
}, "gridLegacyFormatter");
gridLegacyFormatter.renderArray(testOrderedData);
- window.gridLegacyGet = new Grid({
+ window.gridLegacyGet = new dgrid.Grid({
columns: columnsLegacyGet
}, "gridLegacyGet");
gridLegacyGet.renderArray(testOrderedData);
- window.gridNew = new Grid({
+ window.gridNew = new dgrid.Grid({
columns: columnsNew
}, "gridNew");
gridNew.renderArray(testOrderedData);
// GridFromHtml tests
- window.gridFromHtmlLegacyFormatter = new GridFromHtml({},
+ window.gridFromHtmlLegacyFormatter = new dgrid.GridFromHtml({},
"gridFromHtmlLegacyFormatter");
gridFromHtmlLegacyFormatter.renderArray(testOrderedData);
- window.gridFromHtmlLegacyGet = new GridFromHtml({},
+ window.gridFromHtmlLegacyGet = new dgrid.GridFromHtml({},
"gridFromHtmlLegacyGet");
gridFromHtmlLegacyGet.renderArray(testOrderedData);
- window.gridFromHtmlNew = new GridFromHtml({},
+ window.gridFromHtmlNew = new dgrid.GridFromHtml({},
"gridFromHtmlNew");
gridFromHtmlNew.renderArray(testOrderedData);
- window.gridFromHtmlTestProps = new GridFromHtml({},
+ window.gridFromHtmlTestProps = new dgrid.GridFromHtml({},
"gridFromHtmlTestProps");
gridFromHtmlTestProps.renderArray(testOrderedData);
// need to expose GridFromHtml as a global for parser to find.
// (need a version with OnDemandGrid for store usage)
- window.OnDemandGridFromHtml = declare([OnDemandGrid, GridFromHtml]);
+ window.OnDemandGridFromHtml = declare([dgrid.OnDemandGrid, dgrid.GridFromHtml]);
// also, need a store, since there's currently no way to effectively
// invoke renderArray from HTML.
@@ -127,34 +132,34 @@
// (works fine if you renderArray after node placement)
// Test 4a: srcNodeRef + no id, specify id to dgrid
- window.grid4a = new OnDemandGrid({
+ window.grid4a = new dgrid.OnDemandGrid({
store: store,
columns: columnsNew,
id: "test4a"
- }, query(".test4a")[0]);
+ }, dojo.query(".test4a")[0]);
// Test 4b: srcNodeRef + no id - should end up with id=dgrid_0
- window.grid4b = new OnDemandGrid({
+ window.grid4b = new dgrid.OnDemandGrid({
store: store,
columns: columnsNew
- }, query(".test4b")[0]);
+ }, dojo.query(".test4b")[0]);
// Test 4c: no srcNodeRef, specify id to dgrid
- window.grid4c = new OnDemandGrid({
+ window.grid4c = new dgrid.OnDemandGrid({
store: store,
columns: columnsNew,
id: "test4c"
});
- query(".test4c")[0].appendChild(grid4c.domNode);
+ dojo.query(".test4c")[0].appendChild(grid4c.domNode);
// need to call resize to calculate header size after node is placed
grid4c.resize();
// Test 4d: no srcNodeRef, no id - should end up with id=dgrid_1
- window.grid4d = new OnDemandGrid({
+ window.grid4d = new dgrid.OnDemandGrid({
store: store,
columns: columnsNew
});
- query(".test4d")[0].appendChild(grid4d.domNode);
+ dojo.query(".test4d")[0].appendChild(grid4d.domNode);
// need to call resize to calculate header size after node is placed
grid4d.resize();
});

0 comments on commit 5fafdfd

Please sign in to comment.
Something went wrong with that request. Please try again.