Permalink
Browse files

Adding workaround file to DataTable tests. Moving DT examples from Lo…

…ader into onDOMReady callbacks.
  • Loading branch information...
1 parent 7db2919 commit 97d033242aaec55d9b8d95ea3bd897b5c80764ce @lsmith lsmith committed Nov 9, 2009
Showing with 518 additions and 478 deletions.
  1. +2 −1 yui2.8/examples/datatable/dt_autocomplete_caja.html
  2. +1 −0 yui2.8/examples/datatable/dt_basic_caja.html
  3. +3 −2 yui2.8/examples/datatable/dt_bhm_caja.html
  4. +2 −1 yui2.8/examples/datatable/dt_cellediting_caja.html
  5. +2 −1 yui2.8/examples/datatable/dt_cellselect_caja.html
  6. +2 −1 yui2.8/examples/datatable/dt_clientpagination_caja.html
  7. +1 −0 yui2.8/examples/datatable/dt_clientsorting_caja.html
  8. +124 −120 yui2.8/examples/datatable/dt_colshowhide_caja.html
  9. +1 −0 yui2.8/examples/datatable/dt_complex_caja.html
  10. +1 −0 yui2.8/examples/datatable/dt_contextmenu_caja.html
  11. +1 −0 yui2.8/examples/datatable/dt_ddrows_caja.html
  12. +2 −1 yui2.8/examples/datatable/dt_dynamicdata_caja.html
  13. +263 −254 yui2.8/examples/datatable/dt_dynamicfilter_caja.html
  14. +1 −0 yui2.8/examples/datatable/dt_enhanced_caja.html
  15. +1 −0 yui2.8/examples/datatable/dt_fixedscroll_caja.html
  16. +94 −93 yui2.8/examples/datatable/dt_formatting_caja.html
  17. +1 −0 yui2.8/examples/datatable/dt_highlighting_caja.html
  18. +1 −0 yui2.8/examples/datatable/dt_localfilter_caja.html
  19. +1 −0 yui2.8/examples/datatable/dt_nestedheaders_caja.html
  20. +1 −0 yui2.8/examples/datatable/dt_polling_caja.html
  21. +2 −1 yui2.8/examples/datatable/dt_row_coloring_caja.html
  22. +1 −0 yui2.8/examples/datatable/dt_rowdatamod_caja.html
  23. +3 −2 yui2.8/examples/datatable/dt_rowexp_basic_caja.html
  24. +1 −0 yui2.8/examples/datatable/dt_rowselect_caja.html
  25. +1 −0 yui2.8/examples/datatable/dt_tabview_caja.html
  26. +2 −1 yui2.8/examples/datatable/dt_xhrjson_caja.html
  27. +1 −0 yui2.8/examples/datatable/dt_xhrpostxml_caja.html
  28. +1 −0 yui2.8/examples/datatable/dt_xhrtext_caja.html
  29. +1 −0 yui2.8/examples/datatable/dt_xpath_caja.html
@@ -28,6 +28,7 @@
<script type="text/javascript" src="yui/autocomplete/autocomplete-min.js"></script>
<script type="text/javascript" src="yui/element/element-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--there is no custom header content for this example-->
@@ -130,7 +131,7 @@
}
];
- myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");
+ myDataSource = new YAHOO.util.DataSource("../yui2.8/examples/datatable/assets/php/ylocal_proxy.php?");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.connXhrMode = "queueRequests";
myDataSource.responseSchema = {
@@ -25,6 +25,7 @@
<script type="text/javascript" src="yui/element/element-min.js"></script>
<script type="text/javascript" src="yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--begin custom header content for this example-->
@@ -29,6 +29,7 @@
<script type="text/javascript" src="yui/element/element-min.js"></script>
<script type="text/javascript" src="yui/paginator/paginator-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--begin custom header content for this example-->
@@ -59,7 +60,7 @@
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
-<iframe id="yui-history-iframe" src="assets/html/blank.html"></iframe>
+<iframe id="yui-history-iframe" src="../yui2.8/examples/datatable/assets/html/blank.html"></iframe>
<input id="yui-history-field" type="hidden">
<div id="dt-pag-nav"></div>
@@ -68,7 +69,7 @@
<script type="text/javascript">
(function () {
// Create the DataSource
- var myDataSource = new YAHOO.util.DataSource("assets/php/json_proxy.php?");
+ var myDataSource = new YAHOO.util.DataSource("../yui2.8/examples/datatable/assets/php/json_proxy.php?");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.responseSchema = {
resultsList: "records",
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "#">
+<!doctype html>
<html>
<head>
@@ -26,6 +26,7 @@
<script type="text/javascript" src="yui/element/element-min.js"></script>
<script type="text/javascript" src="yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--begin custom header content for this example-->
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "#">
+<!doctype html>
<html>
<head>
@@ -24,6 +24,7 @@
<script type="text/javascript" src="yui/element/element-min.js"></script>
<script type="text/javascript" src="yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--begin custom header content for this example-->
@@ -28,6 +28,7 @@
<script type="text/javascript" src="yui/paginator/paginator-min.js"></script>
<script type="text/javascript" src="yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--begin custom header content for this example-->
@@ -72,7 +73,7 @@
{key:"number", label:"Number"}
];
- var myDataSource = new YAHOO.util.DataSource("assets/php/json_proxy.php?");
+ var myDataSource = new YAHOO.util.DataSource("../yui2.8/examples/datatable/assets/php/json_proxy.php?");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.responseSchema = {
resultsList: "records",
@@ -24,6 +24,7 @@
<script type="text/javascript" src="yui/element/element-min.js"></script>
<script type="text/javascript" src="yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--there is no custom header content for this example-->
@@ -1,6 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "#">
<html>
<head>
+<link type="text/css" rel="stylesheet" href="yui/fonts/fonts.css">
+<link rel="stylesheet" type="text/css" href="yui/button/assets/skins/sam/button.css">
+<link rel="stylesheet" type="text/css" href="yui/container/assets/skins/sam/container.css">
+<link rel="stylesheet" type="text/css" href="yui/datatable/assets/skins/sam/datatable.css">
<style type="text/css">
/* custom styles for this example */
#dt-example {width:45em;margin:0 auto;}
@@ -91,130 +95,130 @@
</div>
</div>
-<script type="text/javascript" src="yui/yuiloader/yuiloader.js"></script>
-<script type="text/javascript" src="./assets/js/data.js"></script>
-<script type="text/javascript">
-var loader = new YAHOO.util.YUILoader();
-loader.insert({
- require: ["fonts", "dragdrop", "container", "button", "datatable"],
- base: 'yui/',
- filter: 'debug',
- allowRollup: false,
- onSuccess: function() {
- YAHOO.example.ColumnShowHide = function() {
- // Define Columns
- var myColumnDefs = [
- {key:"address"},
- {key:"city"},
- {key:"state"},
- {key:"amount"},
- {key:"active"},
- {key:"colors"},
- {key:"last_login", formatter:YAHOO.widget.DataTable.formatDate}
- ];
-
- // Create DataSource
- var myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.addresses);
- myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
- myDataSource.responseSchema = {
- fields: ["address","city","state","amount","active","colors",{key:"last_login",parser:"date"}]
- };
-
- // Create DataTable
- var myDataTable = new YAHOO.widget.DataTable("columnshowhide", myColumnDefs, myDataSource, {draggableColumns:true});
-
- // Shows dialog, creating one when necessary
- var newCols = true;
- var showDlg = function(e) {
- YAHOO.util.Event.stopEvent(e);
+<script src="yui/yahoo-dom-event/yahoo-dom-event.js"></script>
+<script src="yui/element/element.js"></script>
+<script src="yui/button/button.js"></script>
+<script src="yui/dragdrop/dragdrop.js"></script>
+<script src="yui/container/container.js"></script>
+<script src="yui/datasource/datasource.js"></script>
+<script src="yui/datatable/datatable.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
+<script type="text/javascript" src="assets/js/data.js"></script>
+<script>
+YAHOO.util.Event.onDOMReady(function () {
+ YAHOO.example.ColumnShowHide = (function() {
+ // Define Columns
+ var myColumnDefs = [
+ {key:"address"},
+ {key:"city"},
+ {key:"state"},
+ {key:"amount"},
+ {key:"active"},
+ {key:"colors"},
+ {key:"last_login", formatter:YAHOO.widget.DataTable.formatDate}
+ ];
- if(newCols) {
- // Populate Dialog
- // Using a template to create elements for the SimpleDialog
- var allColumns = myDataTable.getColumnSet().keys;
- var elPicker = YAHOO.util.Dom.get("dt-dlg-picker");
- var elTemplateCol = document.createElement("div");
- YAHOO.util.Dom.addClass(elTemplateCol, "dt-dlg-pickercol");
- var elTemplateKey = elTemplateCol.appendChild(document.createElement("span"));
- YAHOO.util.Dom.addClass(elTemplateKey, "dt-dlg-pickerkey");
- var elTemplateBtns = elTemplateCol.appendChild(document.createElement("span"));
- YAHOO.util.Dom.addClass(elTemplateBtns, "dt-dlg-pickerbtns");
- var onclickObj = {fn:handleButtonClick, obj:this, scope:false };
+ // Create DataSource
+ var myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.addresses);
+ myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
+ myDataSource.responseSchema = {
+ fields: ["address","city","state","amount","active","colors",{key:"last_login",parser:"date"}]
+ };
+
+ // Create DataTable
+ var myDataTable = new YAHOO.widget.DataTable("columnshowhide", myColumnDefs, myDataSource, {draggableColumns:true});
- // Create one section in the SimpleDialog for each Column
- var elColumn, elKey, elButton, oButtonGrp;
- for(var i=0,l=allColumns.length;i<l;i++) {
- var oColumn = allColumns[i];
-
- // Use the template
- elColumn = elTemplateCol.cloneNode(true);
-
- // Write the Column key
- elKey = elColumn.firstChild;
- elKey.innerHTML = oColumn.getKey();
-
- // Create a ButtonGroup
- oButtonGrp = new YAHOO.widget.ButtonGroup({
- id: "buttongrp"+i,
- name: oColumn.getKey(),
- container: elKey.nextSibling
- });
- oButtonGrp.addButtons([
- { label: "Show", value: "Show", checked: ((!oColumn.hidden)), onclick: onclickObj},
- { label: "Hide", value: "Hide", checked: ((oColumn.hidden)), onclick: onclickObj}
- ]);
-
- elPicker.appendChild(elColumn);
- }
- newCols = false;
- }
- myDlg.show();
- };
- var hideDlg = function(e) {
- this.hide();
- };
- var handleButtonClick = function(e, oSelf) {
- var sKey = this.get("name");
- if(this.get("value") === "Hide") {
- // Hides a Column
- myDataTable.hideColumn(sKey);
- }
- else {
- // Shows a Column
- myDataTable.showColumn(sKey);
+ // Shows dialog, creating one when necessary
+ var newCols = true;
+ var showDlg = function(e) {
+ YAHOO.util.Event.stopEvent(e);
+
+ if(newCols) {
+ // Populate Dialog
+ // Using a template to create elements for the SimpleDialog
+ var allColumns = myDataTable.getColumnSet().keys;
+ var elPicker = YAHOO.util.Dom.get("dt-dlg-picker");
+ var elTemplateCol = document.createElement("div");
+ YAHOO.util.Dom.addClass(elTemplateCol, "dt-dlg-pickercol");
+ var elTemplateKey = elTemplateCol.appendChild(document.createElement("span"));
+ YAHOO.util.Dom.addClass(elTemplateKey, "dt-dlg-pickerkey");
+ var elTemplateBtns = elTemplateCol.appendChild(document.createElement("span"));
+ YAHOO.util.Dom.addClass(elTemplateBtns, "dt-dlg-pickerbtns");
+ var onclickObj = {fn:handleButtonClick, obj:this, scope:false };
+
+ // Create one section in the SimpleDialog for each Column
+ var elColumn, elKey, elButton, oButtonGrp;
+ for(var i=0,l=allColumns.length;i<l;i++) {
+ var oColumn = allColumns[i];
+
+ // Use the template
+ elColumn = elTemplateCol.cloneNode(true);
+
+ // Write the Column key
+ elKey = elColumn.firstChild;
+ elKey.innerHTML = oColumn.getKey();
+
+ // Create a ButtonGroup
+ oButtonGrp = new YAHOO.widget.ButtonGroup({
+ id: "buttongrp"+i,
+ name: oColumn.getKey(),
+ container: elKey.nextSibling
+ });
+ oButtonGrp.addButtons([
+ { label: "Show", value: "Show", checked: ((!oColumn.hidden)), onclick: onclickObj},
+ { label: "Hide", value: "Hide", checked: ((oColumn.hidden)), onclick: onclickObj}
+ ]);
+
+ elPicker.appendChild(elColumn);
}
- };
-
- // Create the SimpleDialog
- YAHOO.util.Dom.removeClass("dt-dlg", "inprogress");
- var myDlg = new YAHOO.widget.SimpleDialog("dt-dlg", {
- width: "30em",
- visible: false,
- modal: true,
- buttons: [
- { text:"Close", handler:hideDlg }
- ],
- fixedcenter: true,
- constrainToViewport: true
- });
- myDlg.render();
+ newCols = false;
+ }
+ myDlg.show();
+ };
+ var hideDlg = function(e) {
+ this.hide();
+ };
+ var handleButtonClick = function(e, oSelf) {
+ var sKey = this.get("name");
+ if(this.get("value") === "Hide") {
+ // Hides a Column
+ myDataTable.hideColumn(sKey);
+ }
+ else {
+ // Shows a Column
+ myDataTable.showColumn(sKey);
+ }
+ };
+
+ // Create the SimpleDialog
+ YAHOO.util.Dom.removeClass("dt-dlg", "inprogress");
+ var myDlg = new YAHOO.widget.SimpleDialog("dt-dlg", {
+ width: "30em",
+ visible: false,
+ modal: true,
+ buttons: [
+ { text:"Close", handler:hideDlg }
+ ],
+ fixedcenter: true,
+ constrainToViewport: true
+ });
+ myDlg.render();
- // Nulls out myDlg to force a new one to be created
- myDataTable.subscribe("columnReorderEvent", function(){
- newCols = true;
- YAHOO.util.Event.purgeElement("dt-dlg-picker", true);
- YAHOO.util.Dom.get("dt-dlg-picker").innerHTML = "";
- }, this, true);
-
- // Hook up the SimpleDialog to the link
- YAHOO.util.Event.addListener("dt-options-link", "click", showDlg, this, true);
-
- return {
- oDS: myDataSource,
- oDT: myDataTable
- };
- }();
- }
+ // Nulls out myDlg to force a new one to be created
+ myDataTable.subscribe("columnReorderEvent", function(){
+ newCols = true;
+ YAHOO.util.Event.purgeElement("dt-dlg-picker", true);
+ YAHOO.util.Dom.get("dt-dlg-picker").innerHTML = "";
+ }, this, true);
+
+ // Hook up the SimpleDialog to the link
+ YAHOO.util.Event.addListener("dt-options-link", "click", showDlg, this, true);
+
+ return {
+ oDS: myDataSource,
+ oDT: myDataTable
+ };
+ })();
});
</script>
</body>
@@ -28,6 +28,7 @@
<script type="text/javascript" src="yui/paginator/paginator-min.js"></script>
<script type="text/javascript" src="yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--begin custom header content for this example-->
@@ -27,6 +27,7 @@
<script type="text/javascript" src="yui/element/element-min.js"></script>
<script type="text/javascript" src="yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--begin custom header content for this example-->
@@ -25,6 +25,7 @@
<script type="text/javascript" src="yui/element/element-min.js"></script>
<script type="text/javascript" src="yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="yui/datatable/datatable-min.js"></script>
+<script type="text/javascript" src="yui/workaround.js"></script>
<!--begin custom header content for this example-->
Oops, something went wrong.

0 comments on commit 97d0332

Please sign in to comment.