Skip to content

Instantly share code, notes, and snippets.

View stlsmiths's full-sized avatar
🎯
Focusing

Todd Smith stlsmiths

🎯
Focusing
View GitHub Profile
.yui3-skin-sam .yui3-datatable tr.myhilite td { background-color: #C0ffc0; }
var dt = new Y.DataTable({....});
dt.delegate("click",function(e){
var tr = e.target;
@stlsmiths
stlsmiths / gist:2569489
Created May 1, 2012 16:38
yui2.9_loader.html
<html>
<head>
<title>YUI Loader Usage</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
/* define custom styles here */
</style>
</head>
// Class extension to DataTable ...
Y.DataTableAdded = Y.Base.create( 'datatable-added', Y.DataTable, [], {
initializer : function() {
this.delegate( "click", _defTRClickHandler, "tr" );
this.delegate( "click", _defTDClickHandler, "td" ); // need selector work here ...
this.delegate( "click", _defTHClickHandler, "th" );
<html>
<head>
<title>YUI DataTable Exercises</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
/* define your styles here */
</style>
</head>
@stlsmiths
stlsmiths / datatable.js
Created February 6, 2012 17:42 — forked from dhoss/datatable.js
stlsmith's edits
[% page.load_scripts_at_top = 1 %]
<!-- IF you add this, you will run the 3.5.0pr2 code directly from yuilibrary, and can remove all your Gallery crap ...
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.0pr2/build/yui/yui-min.js"></script>
-->
<script type="text/javascript">
/* Delete the gallery stuff
//
// Custom Parser for SQL formatted date strings ...
//
// Following taken directly from Satyam's YUIBlog article:
// http://yuiblog.com/blog/2008/10/15/datatable-260-part-one/
//
// This is used in the formatter below, to first convert the data to a JS Date, then format it !!!
var parseSQLDate = function (o) {
var parts = o.split(' ');
datePart = parts[0].split('-');
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YUI 3 </title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Any Custom CSS goes here -->
</head>
<div id="myChart" style="width:400px;height:400px;"></div>
<script type="text/javascript">
YUI.use('charts', function(Y) {
var myData = [
{category: 'Monday', values: 2},
{category: 'Tuesday', values: 5},
{category: 'Wednesday', values: 7},
{category: 'Thursday', values: 6},
@stlsmiths
stlsmiths / dt_350pr1_array500.html
Created January 5, 2012 21:23
YUI 3.5.0PR1 DT bench example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YUI 3 - DT Benchmarking 3.5.0PR1</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/cssfonts/fonts-min.css" />
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/datatable-base/assets/datatable-base-core.css" />
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/datatable-base/assets/skins/sam//datatable-base-skin.css" />
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/datatable-base/assets/skins/sam//datatable-base-skin.css" />
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/datatable-base/assets/skins/sam//datatable-base.css" />
@stlsmiths
stlsmiths / dt_341_array500.html
Created January 5, 2012 21:22
YUI 3.4.1 DT bench example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YUI 3 - DT Benchmarking 3.4.1</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/cssfonts/fonts-min.css" />
<!-- <link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/datatable-base/assets/datatable-base-core.css" />
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/datatable-base/assets/skins/sam//datatable-base-skin.css" />
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/datatable-base/assets/skins/sam//datatable-base-skin.css" />
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/datatable-base/assets/skins/sam//datatable-base.css" />