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
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
<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
// 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>DT Destroy</title> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
</head> | |
<body class="yui3-skin-sam"> | |
<button id="btnRebuild">Rebuild it!</button> | |
<button id="btnDestroy">Destroy it!</button> |
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
// | |
// Double-click on a cell in last column "Trans Date", opens a pop-up Calendar | |
// in an Overlay | |
// http://www.blunderalong.com/yui/dta/editing/dt_cellediting.html | |
PopupCalView = Y.Base.create('popupCal',Y.View,[],{ | |
// Setup static properties to hold instances of Overlay and Calendar | |
_overlay: null, |
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 dt = new Y.DataTable({ | |
columns: ... | |
paginator: ..... | |
requestStringTemplate: "?page={page}&itemsPerPage={itemsPerPage}&sortBy={sortBy}" // or whatever | |
}); |
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
// if you're using DataSource.IO see http://yuilibrary.com/yui/docs/api/classes/DataSource.IO.html#event_response | |
// if you're using DataSource.Get see http://yuilibrary.com/yui/docs/api/classes/DataSource.Get.html#event_response | |
// listen for the DS response as .... | |
myYUI3DataSource.after('response', function(o) { | |
/* the response object contains the following; | |
o.response.meta, = meta fields parsed from the DataSchema "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
/** | |
This assumes you have "data" with the following "keys" defined, | |
customer_id, customer_name, carrier_name, carrier_id | |
It defines an HTML template as the base link HTML and uses a | |
YUI3 substitution function (Y.Lang.sub) to safely replace the | |
tokens within the htmlTMPL. | |
You must have "allowHTML:true" set for this to work properly. |
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
BaseView = Y.Base.create('baseview', Y.View,[],{ | |
// | |
// my awesome BaseView statics and methods | |
// | |
},{ | |
ATTRS:{ | |
// | |
// my awesome BaseView ATTRS | |
// | |
} |