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
<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> |
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
// 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" ); |
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
<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> |
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
.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; |
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().use( "datatable-scroll", "datatable-message", "datatable-datasource", "datasource-io", "datasource-xmlschema", function (Y) { | |
// | |
// Define the DataSource, can't use DataSource.Get with XML (only supports JSON), | |
// so define an IO DS and plugin the Schema | |
// | |
var myDS = new Y.DataSource.IO({ source: '../srvDataGET.php?iact=xml' }); | |
myDS.plug(Y.Plugin.DataSourceXMLSchema, { | |
schema: { |
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
// Need to create a one-time extension of DataTableDataSource Plugin, | |
DTDSAddPag = Y.Base.create('datasourcepag', Y.Plugin.DataTableDataSource, [], { | |
// Need to override this base method ... | |
onDataReturnInitializeTable: function(e) { | |
var records = (e.response && e.response.results) || []; | |
// Add this to update the DS state |
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
/* | |
We need to somehow build in mapping between the Paginator.Model ATTRS and | |
remote server request for both "outgoing" and "response" data. | |
I was thinking of a "server hash" in some manner, that could handle the | |
translation for known Paginator.Model attributes to both url/querystring | |
placeholders for outgoing request, and to handle returned data in the | |
incoming response back from the server (... that need to be loaded back | |
into the Paginator.Model [think totalRecords]) |
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({ | |
filter:'raw', combine:false, | |
// paginator-view is on YUI Gallery | |
modules: { | |
'datatable-paginator': { | |
fullpath: "http://www.jbistudios.com/applicationdev/js/yui/build/datatable-paginator-class/datatable-paginator-class.js", | |
type: 'js', | |
requires: [ "datatable-base", "base-build", "event-custom" ] | |
} |
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({ | |
filter:'raw', combine:false, | |
modules: { | |
'datatable-paginator': { | |
fullpath: "http://www.jbistudios.com/applicationdev/js/yui/build/datatable-paginator-class/datatable-paginator-class.js", | |
type: 'js', | |
requires: [ "datatable-base", "base-build", "event-custom" ] | |
}, | |
'paginator-css' : { | |
fullpath: "http://jbistudios.com/applicationdev/js/yui/build/paginator-mv/assets/paginator-view.css", |
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({ | |
// use PaginatorView and DataTable-Paginator from the YUI Gallery | |
gallery: 'gallery-2012.08.29-20-10' | |
}).use( 'datatable-sort', ..... blah, blah, blah, blah ... | |
'model-sync-rest', | |
'gallery-datatable-paginator', 'gallery-paginator-view', | |
function(Y) { |