This describes how to set up your dev environment to build and test the DataTable code as it is proposed in pull request 70 (yui/yui3#70).
- Local build of yui/yui3 repo from github
- Local build of yui/builder from github
YUI.add('datatable-node', function (Y) { | |
Y.Plugin.DataTable = Y.Base.create('datatable', Y.DataTable, [], { | |
initializer: function (config) { | |
// Get the string contents of each <th> in the <thead> as an array | |
var columns = config.host.all('thead th').get('text'), | |
count = columns.length, | |
data = [], | |
i; |
nsLeftPanel.cols = [ | |
{ | |
key:"email", | |
label:"Email", | |
formatter: function (o) { | |
if (o.data.id === nsLeftPanel.selectedRowId) { | |
o.rowClass += 'clickedRow'; | |
} | |
if (!o.data.active) { | |
o.rowClass += ' inactiveShopper'; |
{ | |
key: "pt_name", | |
label:"Pt name", | |
sortable:true, | |
formatter:fmt.general.ptNameFormatter, | |
sortOptions:{ | |
sortFunction: function(a,b,desc,field){ | |
desc = desc ? -1 : 1; | |
var name_a = fmt.general.getPtName(a), |
YUI.add('event-multi-defaultFn', function (Y) { | |
// FIXME: publish() needs to be patched to support allowing this to be called before | |
// publish(). Today, the publish() call will clobber the AOP wrapper. | |
Y.EventTarget.prototype.addEventBehavior = function (type, fn, when) { | |
var event = this.getEvent(type), | |
method = when === 'before' ? 'before' : 'after', | |
handle; |
<!doctype html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Test Page</title> | |
</head> | |
<body> | |
<div id="x"> | |
<button id="btn3">Button 3</button> | |
<button id="btn4">Button 4</button> | |
</div> |
Y.DataTable.prototype.getCellColumnKey = function (node) { | |
var classRE = new RegExp('\b' + this.getClassName('col') + '-(\W+)'), | |
name, column; | |
node = node.ancestor('.' + this.getClassName('cell'), true); | |
if (node) { | |
name = (node.get('className').match(classRE) || [])[1]; | |
column = name && this.getColumn(name); |
Node.ATTRS.outerWidth = { | |
getter: function (el) { | |
return el.offsetWidth + | |
(parseInt(this.getComputedStyle('marginLeft'), 10) | 0) + | |
(parseInt(this.getComputedStyle('marginRight'), 10) | 0); | |
} | |
}; | |
node.get('outerWidth'); // e.g. 300 |
// Version 1. Without separate 'uploader' module | |
YUI.add('uploader-flash', function (Y) { | |
function FlashUploader() { ... } | |
Uploader.ATTRS = { | |
}; | |
Y.mix(FlashUploader.prototype, { | |
// prototype definition of Y.Uploader |
YUI.add('gallery-getscrollbarwidth', function (Y) { | |
Y.DOM.getScrollbarWidth = Y.cached(function () { | |
var doc = Y.config.doc, | |
testNode = doc.createElement('div'), | |
body = doc.getElementsByTagName('body')[0], | |
// 0.1 because cached doesn't support falsy refetch values | |
width = 0.1; | |
if (body) { | |
testNode.style.cssText = "position:absolute;visibility:hidden;overflow:scroll;width:20px;"; |
This describes how to set up your dev environment to build and test the DataTable code as it is proposed in pull request 70 (yui/yui3#70).