This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta http - equiv = "content-type"content = "text/html; charset=utf-8"> | |
<title>Server - side Pagination and Sorting for Dynamic Data </title> | |
<link rel="stylesheet" type="text/css " href="datatable2.css " /> | |
<script type="text / javascript " src="js / yahoo - dom - event.js "></script> | |
<script type="text / javascript " src="js / connection - min.js "></script> | |
<script type="text / javascript " src="js / dragdrop - min.js "></script> | |
<script type="text / javascript " src="js / dom - min.js "></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/my/local/yui3/build/yui/yui.js"></script> | |
<script src="custom_module.js"></script> | |
<script> | |
// This does not work | |
YUI({ | |
base: '/my/local/yui3/build/', | |
modules:{ | |
myapp:{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Test Page</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script> | |
<script type="text/javascript"> | |
YAHOO.util.Event.onContentReady('a', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function defaultGenerateRequest(oState, oSelf) { | |
// Set defaults | |
oState = oState || { pagination: null, sortedBy: null }; | |
var sort = encodeURIComponent((oState.sortedBy) ? oState.sortedBy.key : | |
oSelf.getColumnSet().keys[0].getKey()), | |
dir = (oState.sortedBy && | |
oState.sortedBy.dir === YAHOO.widget.DataTable.CLASS_DESC) ? | |
"desc" : "asc", | |
startIndex = (oState.pagination) ? oState.pagination.recordOffset : 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DataTable #3 - Checkbox click allows row selection | |
Ex.dataTable3.subscribe('rowClickEvent',Ex.dataTable3.onEventSelectRow); | |
Ex.dataTable3.subscribe('rowSelectEvent',Ex.dataTable3.check); | |
Ex.dataTable3.subscribe('unselectAllRowsEvent',Ex.dataTable3.uncheckAll); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var before = { | |
"12": "John", | |
"100": "Mary" | |
}; | |
var after = [], | |
k; | |
for (k in before) { | |
if (before.hasOwnProperty(k)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1. simple assignment and retrieval | |
// set | |
var x = "Hello, world"; | |
// get | |
alert(x); | |
// Step 2. object property assignment and retrieval | |
var x = { | |
foo: "Hello, world" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Test Page</title> | |
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/combo?2.7.0/build/datatable/assets/skins/sam/datatable.css&2.7.0/build/paginator/assets/skins/sam/paginator.css"> | |
</head> | |
<body class="yui-skin-sam"> | |
<div id="pag"></div> | |
<div id="tbl"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI({base: '/yui3/build/'}).use('node',function (Y) { | |
function report(source, context, args) { | |
console.log( | |
source, "\n", | |
"customContext.property( " + context.property + " )", "\n", | |
"callback args: " + [].slice.call(args).join(',')); | |
} | |
// From Y.on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Y.Console.prototype.printBuffer = function (limit) { | |
var messages = this.buffer, | |
debug = Y.config.debug, | |
entries = Y.Node.create('div'), | |
consoleLimit= this.get('consoleLimit'), | |
newestOnTop = this.get('newestOnTop'), | |
anchor = newestOnTop ? this._body.get('firstChild') : null, | |
method = newestOnTop ? "prepend" : "append", | |
message, | |
entry, |