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 functionality | |
YUI({skin: 'night'}).use('autocomplete', 'autocomplete-filters', 'autocomplete-highlighters', 'datatable-sort', 'datatable-scroll', 'cssfonts', 'cssbutton', 'dataschema-json', 'datatable-datasource', 'datasource-io', 'datatype', "datasource-jsonschema", 'model-sync-rest', 'gallery-paginator-view', 'gallery-datatable-paginator', 'dataschema', function(Y){ | |
// Create datasource | |
var ds = new Y.DataSource.IO({source: '/index/test/load'}); | |
ds.plug(Y.Plugin.DataSourceJSONSchema, { | |
schema: { | |
resultListLocator: 'Results', | |
resultFields: ['id', 'name'], | |
metaFields: { |
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> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Your Title</title> | |
<!-- Enter any page specific CSS link files --> | |
<link href="/yui/google-code-prettify/prettify.css" rel="stylesheet" type="text/css" /> | |
<!-- Enter any local CSS declarations here --> | |
<style></style> |
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.MyAwesomeView = Y.Base.create('myview',Y.View,[],{ | |
// static props and methods | |
},{ | |
// attrs and stuff | |
}); | |
// referring to http://yuilibrary.com/yui/docs/api/classes/Base.html#method_create | |
// |
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
// | |
// trying to implement "named" formatters ... as {key:'foo', formatter:"currency2", ...} | |
// | |
// getting close ... http://blunderalong.com/yui/dtb/dt_formatters1.html | |
// | |
YUI.add("dt-formatters", function(Y){ | |
var DtFormatStrings = { |
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) { |
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({ | |
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
/* | |
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
// 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
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: { |