HTML:
<!-- YUI Includes //-->
<link rel="stylesheet" type="text/css" media="screen" href="http://yui.yahooapis.com/combo?2.8.0r4/build/button/assets/skins/sam/button.css&2.8.0r4/build/datatable/assets/skins/sam/datatable.css" />
<script type="text/javascript"
src="http://yui.yahooapis.com/combo?2.8.0r4/build/yahoo-dom-event/yahoo-dom-event.js&2.8.0r4/build/element/element-min.js&2.8.0r4/build/button/button-min.js&2.8.0r4/build/datasource/datasource-min.js&
2.8.0r4/build/datatable/datatable-min.js"></script>
<!-- My Includes //-->
<script type="text/javascript" src="/js/a.js"></script>
....
<div id="basic" class="yui-skin-sam"></div>
/js/a.js
YAHOO.example.Data = {
bookorders: [
{address:"po-0167", suburb:new Date(1980, 2, 24), quantity:1, amount:4, title:"A Book About Nothing"},
{address:"po-0783", suburb:new Date("January 3, 1983"), quantity:null, amount:12.12345, title:"The Meaning of Life"},
{address:"po-0297", suburb:new Date(1978, 11, 12), quantity:12, amount:1.25, title:"This Book Was Meant to Be Read Aloud"},
{address:"po-1482", suburb:new Date("March 11, 1985"), quantity:6, amount:3.5, title:"Read Me Twice"},
{address:"po-0167", suburb:new Date(1980, 2, 24), quantity:1, amount:4, title:"A Book About Nothing"},
{address:"po-0783", suburb:new Date("January 3, 1983"), quantity:null, amount:12.12345, title:"The Meaning of Life"},
{address:"po-0297", suburb:new Date(1978, 11, 12), quantity:12, amount:1.25, title:"This Book Was Meant to Be Read Aloud"},
{address:"po-1482", suburb:new Date("March 11, 1985"), quantity:6, amount:3.5, title:"Read Me Twice"},
{address:"po-0167", suburb:new Date(1980, 2, 24), quantity:1, amount:4, title:"A Book About Nothing"},
{address:"po-0783", suburb:new Date("January 3, 1983"), quantity:null, amount:12.12345, title:"The Meaning of Life"},
{address:"po-0297", suburb:new Date(1978, 11, 12), quantity:12, amount:1.25, title:"This Book Was Meant to Be Read Aloud"},
{address:"po-1482", suburb:new Date("March 11, 1985"), quantity:6, amount:3.5, title:"Read Me Twice"}
]
};
YAHOO.util.Event.addListener(window, "load", function() {
YAHOO.example.Scrolling = function() {
var myColumnDefs = [
{key:"address", sortable:true, resizeable:true, width:200},
{key:"suburb", formatter:YAHOO.widget.DataTable.formatDate, sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC},resizeable:true},
{key:"quantity", formatter:YAHOO.widget.DataTable.formatNumber, sortable:true, resizeable:true},
{key:"amount", formatter:YAHOO.widget.DataTable.formatCurrency, sortable:true, resizeable:true},
{key:"title", sortable:true, resizeable:true}
];
var myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.bookorders);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
myDataSource.responseSchema = {
fields: ["address","suburb","quantity","amount","title"]
};
var myDataTable = new YAHOO.widget.ScrollingDataTable("basic", myColumnDefs,
myDataSource, {height:"100%", COLOR_COLUMNFILLER:"red"});
return {
oDS: myDataSource,
oDT: myDataTable
};
}();
});
I managed to fix the bug locally by changing the following in datatable/datatable.js
before:
this.setAttributeConfig("COLOR_COLUMNFILLER", {
value: "#F2F2F2",
validator: lang.isString,
method: function(oParam) {
this._elHdContainer.style.backgroundColor = oParam;
}
});
after:
this.setAttributeConfig("COLOR_COLUMNFILLER", {
value: "#F2F2F2",
validator: lang.isString,
method: function(oParam) {
if(this._elHdContainer && this._elBdContainer) {
this._elHdContainer.style.backgroundColor = oParam;
}
}
});
quick note, either setting the COLOR_CULUMNFILLER property as the color string "red", or the hex color code "#ff0000" causes the same error.