-
-
Save teaualune/6062663 to your computer and use it in GitHub Desktop.
This file contains 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>T.T. in GT Lab</title> | |
<meta http-equiv=content-type content="text/html; charset=utf-8"> | |
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.10.2/build/cssreset/cssreset-min.css"> | |
<style type="text/css"> | |
#query { | |
margin: 10px 0; | |
} | |
#controls { | |
margin: 10px 0; | |
} | |
.rpp { | |
padding-left: 1.5em; | |
} | |
.yui3-skin-sam .yui3-datatable caption { | |
padding: 0 !important; | |
} | |
.yui3-skin-sam .yui3-paginator-rpp-options { | |
margin-left: 0; | |
} | |
</style> | |
</head> | |
<body class="yui3-skin-sam"> | |
Good morning Georgia! | |
<h1><a href="https://www.facebook.com/bjeremyl">T.T FB</a> ~~~~~~</h1> | |
<hr> | |
<form id="query-form" name="query_form"> | |
<div id="query"></div> | |
</form> | |
<div> | |
<div id="simple"></div> | |
<button id="button1">I Love</button> | |
<button id="button2">YuZu</button> | |
<button id="button3">(~"~)</button> | |
</div> | |
<input type="text" placeholder="search name..." /> | |
<script src="http://yui.yahooapis.com/3.10.2/build/yui/yui-min.js"></script> | |
<script> | |
YUI({ | |
gallery: 'gallery-2013.06.26-23-09' | |
}).use( | |
'datatable-datasource', | |
'datasource-arrayschema', | |
'gallery-querybuilder', | |
'gallery-formmgr', | |
'gallery-paginator', | |
'array-extras', | |
function (Y) { | |
var data = [ | |
{id: 'n1', name: "Brian", years: 23, price: "$16.88 (On-Sale)"}, | |
{id: 'n2', name: "Emily", years: 24, price: "$29.99"}, | |
{id: 'n3', name: "TaiYen", years: "forever 19", price: "Priceless"}, | |
], | |
// A table from data with keys that work fine as column names | |
simple = new Y.DataTable({ | |
//可以不要 | |
columns: ["name", "years", "price"], | |
//data:不可改成→data= | |
data: data, | |
summary: "Price sheet for inventory parts QQ", | |
caption: "Example table with simple columns" | |
}), | |
dataObject = { | |
"Brian": "$16.88 (On-Sale)", | |
"Emily": "$29.99", | |
"TaiYen": "Priceless" | |
}; | |
Y.on("click", function (e) { | |
simple.render("#simple"); | |
Y.one("#simple").show(); | |
}, '#button1'); | |
Y.on("click", function (e) { | |
Y.one("#simple").hide(); | |
}, '#button2') ; | |
Y.on("click", function (e) { | |
var searchText = Y.one('input').get('value'); | |
alert(dataObject[searchText] ? dataObject[searchText] : 'Are you kidding?'); | |
}, '#button3'); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment