Skip to content

Instantly share code, notes, and snippets.

View stlsmiths's full-sized avatar
🎯
Focusing

Todd Smith stlsmiths

🎯
Focusing
View GitHub Profile
@stlsmiths
stlsmiths / dt_290_array500.html
Created January 5, 2012 21:21
YUI 2.9.0 DT bench example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YUI 2 - DT Benchmarking 2.9.0</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body class="yui-skin-sam">
<script src="http://yui.yahooapis.com/2.9.0/build/yuiloader/yuiloader-min.js"></script>
@stlsmiths
stlsmiths / README.markdown
Created January 4, 2012 23:48
YUI 3.5.0PR1 new DataTable benchmarking - 500 records

Initial Benchmarking of YUI 2 vs YUI 3 DataTables

This was a basic "brute force" testing for basic timings, using the YUI Console tool -- definitely not a comprehensive study (i.e. no profiling, etc..).

The basic test consists of creating and rendering a simple DT (no parsing, formatting, sorting, scrolling, editing, etc...) using a local Javascript Array for the data with 500 records. Yes, I know 500 records is quite a lot of data without using other features (pagination, scrolling), but I wanted something to allow enough time and enough page elements to make it somewhat interesting!

CASE 1 : The YUI 2.9 DT example dt_290_array500.html and source at gist 1567371

CASE 2 : The YUI 3.4.1 DT example dt_341_array500.html and source at gist 1567375

// Define a custom formatter to format Numbers as US currency format, and if negative, to
// set color to RED and surround with parenthesis;
// Example: ( $ 12,345.67 ) in red
// Note: Function needs to be defined BEFORE the Column definitions that use it !!
var fmtNegCurrency = function(elCell, oRec, oCol, oData) {
var num_prefix='',
num_suffix='';
if ( oData < 0.0 ) {
YAHOO.util.Dom.setStyle(elCell,'color','red');
@stlsmiths
stlsmiths / YUI3_resize.html
Created August 24, 2011 17:37
YUI3 Resize with start event
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Resize Example</title>
<style type="text/css">
#demo {
height: 100px;
width: 100px;
@stlsmiths
stlsmiths / dt_ex_frames.html
Created July 21, 2011 21:43
YUI2 DT example with conditional dropdowns
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>YUI DataTable Example</title>
<script src="http://yui.yahooapis.com/2.9.0/build/yuiloader/yuiloader-min.js"></script>
<script type="text/javascript">
@stlsmiths
stlsmiths / gist:1057797
Created July 1, 2011 03:08
YUI2 DataTable populated via Ajax call storing as local JSARRAY
<html>
<head>
<title>YUI DataTable Exercises</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script src="http://yui.yahooapis.com/2.9.0/build/yuiloader/yuiloader-min.js"></script>
<style type="text/css">
div.info {
background:#ffc;
@stlsmiths
stlsmiths / dt_json_local_parse.html
Created June 15, 2011 16:02
YUI2 local JSON complex parse with DataTable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>YUI DataTable Example</title>
<script src="http://yui.yahooapis.com/2.9.0/build/yuiloader/yuiloader-min.js"></script>
<script type="text/javascript">
@stlsmiths
stlsmiths / dt_color_fmtRow.html
Created June 14, 2011 04:05
YUI 2 DataTable Row Coloring
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>YUI DataTable Example</title>
<script src="http://yui.yahooapis.com/2.9.0/build/yuiloader/yuiloader-min.js"></script>
<style type="text/css">
/* Define TR styles for each possible color combo */
@stlsmiths
stlsmiths / parser.js
Created June 10, 2011 20:09
A great JS formula parser - this is a fork
/*
Based on ndef.parser, by Raphael Graf([email protected])
http://www.undefined.ch/mparser/index.html
Website http://silentmatt.com/javascript-expression-evaluator/
*/
// Added by TES 6/13/2011
// re-define indexOf, because IE doesn't know it ...
// from http://stellapower.net/content/javascript-support-and-arrayindexof-ie
@stlsmiths
stlsmiths / datatable_nav.js
Created June 10, 2011 20:07
YUI 2 DataTable keyboard navigation prototypes
//--------------------------------------------------------------------------------------
// TODD'S Table Nav Stuff ...... BEGIN
//
// Functions allow cell navigation within a DataTable, first developed in pmgr/trans_grid.html
//
//
//
YAHOO.widget.DataTable.prototype.getFirstVisTdEl = function(cell) {
if ( !cell ) return null;