update YUI to 2.8.0r4
This commit is contained in:
parent
27f474ec64
commit
2d28e0c0ba
2007 changed files with 344487 additions and 210070 deletions
BIN
www/extras/yui/examples/datatable/assets/images/arrow_closed.png
Normal file
BIN
www/extras/yui/examples/datatable/assets/images/arrow_closed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 174 B |
BIN
www/extras/yui/examples/datatable/assets/images/arrow_open.png
Normal file
BIN
www/extras/yui/examples/datatable/assets/images/arrow_open.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 167 B |
BIN
www/extras/yui/examples/datatable/assets/images/spinner.gif
Normal file
BIN
www/extras/yui/examples/datatable/assets/images/spinner.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
984
www/extras/yui/examples/datatable/assets/js/data.js
vendored
984
www/extras/yui/examples/datatable/assets/js/data.js
vendored
|
|
@ -1,490 +1,494 @@
|
|||
YAHOO.example.Data = {
|
||||
apitester: [
|
||||
{number:0, date:new Date(1999, 1, 1), string:"1"},
|
||||
{number:1, date:new Date(1999, 10, 10), string:"12"},
|
||||
{number:2, date:new Date(2000, 1, 1), string:"123"},
|
||||
{number:3, date:new Date(2000, 10, 1), string:"10"},
|
||||
{number:4, date:new Date(2001, 10, 12), string:"1"},
|
||||
{number:5, date:new Date(2001, 1, 12), string:"123"},
|
||||
{number:6, date:new Date(2001, 10, 1), string:"11"},
|
||||
{number:7, date:new Date(2001, 10, 1), string:"16"},
|
||||
{number:8, date:new Date(2001, 10, 1), string:"8"},
|
||||
{number:9, date:new Date(2001, 10, 1), string:"6"},
|
||||
{number:10, date:new Date(2001, 10, 1), string:"66"},
|
||||
{number:11, date:new Date(2001, 10, 1), string:"111"},
|
||||
{number:12, date:new Date(2001, 10, 1), string:"110"}
|
||||
],
|
||||
|
||||
multitypes: {
|
||||
items: [
|
||||
{field1: "bananas", field2:new Date(2007, 1, 1), field3:111, field4:"23.4", field5:"bob", field6:"http://www.yahoo.com"},
|
||||
{field1: "cherries", field2:new Date(2006, 1, 1), field3:12.3, field4:"35.12", field5:"ann", field6:"http://www.yahoo.com"},
|
||||
{field1: "apples", field2:new Date(2007, 11, 1), field3:1, field4:34.12, field5:"charlie", field6:"http://www.yahoo.com"},
|
||||
{field1: "bananas", field2:new Date(2007, 1, 11), field3:1112, field4:"03", field5:"diane", field6:"http://www.yahoo.com"},
|
||||
{field1: "cherries", field2:new Date(1999, 1, 11), field3:124, field4:03, field5:"edgar", field6:"http://www.yahoo.com"},
|
||||
{field1: "bananas", field2:"January 10, 2005", field3:"12", field4:"34", field5:"francine", field6:"http://www.yahoo.com"},
|
||||
{field1: "apples", field2:"January 1, 2005", field3:"19.1", field4:"234.5", field5:"george", field6:"http://www.yahoo.com"},
|
||||
{field1: "bananas", field2:"1/11/05", field3:"10.02", field4:"345.654", field5:"hannah", field6:"http://www.yahoo.com"},
|
||||
{field1: "cherries", field2:"1/11/2005", field3:"109", field4:23.456, field5:"igor", field6:"http://www.yahoo.com"},
|
||||
{field1: "bananas", field2:"November 1, 2005", field3:"11111", field4:23.0123, field5:"julie", field6:"http://www.yahoo.com"}
|
||||
]
|
||||
},
|
||||
|
||||
webstats: [
|
||||
["home.html",20,400,44,657],
|
||||
["blog.html",24,377,97,567],
|
||||
["contact.html",32,548,42,543],
|
||||
["about.html",8,465,12,946],
|
||||
["pagenotfound.html",0,0,0,0]
|
||||
],
|
||||
|
||||
emails: {
|
||||
account:"jenny@yahoo.com",
|
||||
currStorage: 10,
|
||||
maxStorage: 200,
|
||||
messages: [
|
||||
{XID: "9897",Date:new Date(1981, 2, 24),To:"Joe",From:"Jenny",Unread:false,Subject:"Check out my new pictures"},
|
||||
{XID: "7899",Date:new Date(1980, 1, 11),To:"Jane",From:"Jenny",Unread:false,Subject:"Let's have lunch"},
|
||||
{XID: "6789",Date:new Date(1978, 11, 12),To:"Ann",From:"Jenny",Unread:false,Subject:"Here's the info you requested"},
|
||||
{XID: "4996",Date:new Date(1974, 1, 11),To:"Bob",From:"Jenny",Unread:true,Subject:"RE: Let's have lunch"},
|
||||
{XID: "4544",Date:new Date(1974, 1, 10),To:"Charlie",From:"Jenny",Unread:false,Subject:"Birthday party Saturday"}
|
||||
]
|
||||
},
|
||||
|
||||
inventory: [
|
||||
{SKU:"23-23874", Quantity:43, Item:"Helmet", Description:"Red baseball helmet. Size: Large."},
|
||||
{SKU:"48-38835", Quantity:84, Item:"Football", Description:"Leather football."},
|
||||
{SKU:"84-84848", Quantity:31, Item:"Goggles", Description:"Light blue swim goggles"},
|
||||
{SKU:"84-84843", Quantity:56, Item:"Badminton Set", Description:"Set of 2 badminton rackets, net, and 3 birdies."},
|
||||
{SKU:"84-39321", Quantity:128, Item:"Tennis Balls", Description:"Canister of 3 tennis balls."},
|
||||
{SKU:"39-48949", Quantity:55, Item:"Snowboard", Description:""},
|
||||
{SKU:"99-28128", Quantity:77, Item:"Cleats", Description:"Soccer cleats. Size: 10."},
|
||||
{SKU:"83-48281", Quantity:65, Item:"Volleyball", Description:""},
|
||||
{SKU:"89-32811", Quantity:12, Item:"Sweatband", Description:"Blue sweatband. Size: Medium."},
|
||||
{SKU:"28-22847", Quantity:43, Item:"Golf Set", Description:"Set of 9 golf clubs and bag."},
|
||||
{SKU:"38-38281", Quantity:1, Item:"Basketball Shorts", Description:"Green basketball shorts. Size: Small."},
|
||||
{SKU:"82-38333", Quantity:288, Item:"Lip balm", Description:"Lip balm. Flavor: Cherry."},
|
||||
{SKU:"21-38485", Quantity:177, Item:"Ping Pong Ball", Description:""},
|
||||
{SKU:"83-38285", Quantity:87, Item:"Hockey Puck", Description:"Glow-in-the-dark hockey puck."}
|
||||
],
|
||||
|
||||
addresses: [
|
||||
{name:"John A. Smith", address:"1236 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan B. Jones", address:"3271 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob C. Uncle", address:"9996 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John D. Smith", address:"1623 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan E. Jones", address:"3217 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob F. Uncle", address:"9899 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John G. Smith", address:"1723 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan H. Jones", address:"3241 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob I. Uncle", address:"9909 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John J. Smith", address:"1623 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan K. Jones", address:"3721 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob L. Uncle", address:"9989 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John M. Smith", address:"1293 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan N. Jones", address:"3621 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob O. Uncle", address:"9959 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John P. Smith", address:"6123 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan Q. Jones", address:"3281 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob R. Uncle", address:"9989 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"}
|
||||
],
|
||||
|
||||
bookorders: [
|
||||
{id:"po-0167", date:new Date(1980, 2, 24), quantity:1, amount:4, title:"A Book About Nothing"},
|
||||
{id:"po-0783", date:new Date("January 3, 1983"), quantity:null, amount:12.12345, title:"The Meaning of Life"},
|
||||
{id:"po-0297", date:new Date(1978, 11, 12), quantity:12, amount:1.25, title:"This Book Was Meant to Be Read Aloud"},
|
||||
{id:"po-1482", date:new Date("March 11, 1985"), quantity:6, amount:3.5, title:"Read Me Twice"}
|
||||
],
|
||||
|
||||
stateAbbrs: [
|
||||
"AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI",
|
||||
"ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS",
|
||||
"MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR",
|
||||
"PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"
|
||||
],
|
||||
|
||||
areacodes: [
|
||||
{areacode: "201", state: "New Jersey"},
|
||||
{areacode: "202", state: "Washington, DC"},
|
||||
{areacode: "203", state: "Connecticut"},
|
||||
{areacode: "204", state: "Manitoba, Canada"},
|
||||
{areacode: "205", state: "Alabama"},
|
||||
{areacode: "206", state: "Washington"},
|
||||
{areacode: "207", state: "Maine"},
|
||||
|
||||
{areacode: "208", state: "Idaho"},
|
||||
{areacode: "209", state: "California"},
|
||||
{areacode: "210", state: "Texas"},
|
||||
{areacode: "212", state: "New York"},
|
||||
{areacode: "213", state: "California"},
|
||||
{areacode: "214", state: "Texas"},
|
||||
|
||||
{areacode: "215", state: "Pennsylvania"},
|
||||
{areacode: "216", state: "Ohio"},
|
||||
{areacode: "217", state: "Illinois"},
|
||||
{areacode: "218", state: "Minnesota"},
|
||||
{areacode: "219", state: "Indiana"},
|
||||
{areacode: "224", state: "Illinois"},
|
||||
|
||||
{areacode: "225", state: "Louisiana"},
|
||||
{areacode: "227", state: "Maryland"},
|
||||
{areacode: "228", state: "Mississippi"},
|
||||
{areacode: "229", state: "Georgia"},
|
||||
{areacode: "231", state: "Michigan"},
|
||||
{areacode: "234", state: "Ohio"},
|
||||
|
||||
{areacode: "239", state: "Florida"},
|
||||
{areacode: "240", state: "Maryland"},
|
||||
{areacode: "242", state: "Bahamas"},
|
||||
{areacode: "246", state: "Barbados"},
|
||||
{areacode: "248", state: "Michigan"},
|
||||
{areacode: "250", state: "British Columbia"},
|
||||
|
||||
{areacode: "251", state: "Alabama"},
|
||||
{areacode: "252", state: "North Carolina"},
|
||||
{areacode: "253", state: "Washington"},
|
||||
{areacode: "254", state: "Texas"},
|
||||
{areacode: "256", state: "Alabama"},
|
||||
{areacode: "260", state: "Indiana"},
|
||||
|
||||
{areacode: "262", state: "Wisconsin"},
|
||||
{areacode: "264", state: "Anguilla"},
|
||||
{areacode: "267", state: "Pennsylvania"},
|
||||
{areacode: "268", state: "Antigua and Barbuda"},
|
||||
{areacode: "269", state: "Michigan"},
|
||||
{areacode: "270", state: "Kentucky"},
|
||||
|
||||
{areacode: "276", state: "Virginia"},
|
||||
{areacode: "281", state: "Texas"},
|
||||
{areacode: "283", state: "Ohio"},
|
||||
{areacode: "284", state: "British Virgin Islands"},
|
||||
{areacode: "289", state: "Ontario"},
|
||||
{areacode: "301", state: "Maryland"},
|
||||
|
||||
{areacode: "302", state: "Delaware"},
|
||||
{areacode: "303", state: "Colorado"},
|
||||
{areacode: "304", state: "West Virginia"},
|
||||
{areacode: "305", state: "Florida"},
|
||||
{areacode: "306", state: "Saskatchewan, Canada"},
|
||||
{areacode: "307", state: "Wyoming"},
|
||||
|
||||
{areacode: "308", state: "Nebraska"},
|
||||
{areacode: "309", state: "Illinois"},
|
||||
{areacode: "310", state: "California"},
|
||||
{areacode: "312", state: "Illinois"},
|
||||
{areacode: "313", state: "Michigan"},
|
||||
{areacode: "314", state: "Missouri"},
|
||||
|
||||
{areacode: "315", state: "New York"},
|
||||
{areacode: "316", state: "Kansas"},
|
||||
{areacode: "317", state: "Indiana"},
|
||||
{areacode: "318", state: "Louisiana"},
|
||||
{areacode: "319", state: "Iowa"},
|
||||
{areacode: "320", state: "Minnesota"},
|
||||
|
||||
{areacode: "321", state: "Florida"},
|
||||
{areacode: "323", state: "California"},
|
||||
{areacode: "330", state: "Ohio"},
|
||||
{areacode: "331", state: "Illinois"},
|
||||
{areacode: "334", state: "Alabama"},
|
||||
{areacode: "336", state: "North Carolina"},
|
||||
|
||||
{areacode: "337", state: "Louisiana"},
|
||||
{areacode: "339", state: "Massachusetts"},
|
||||
{areacode: "340", state: "US Virgin Islands"},
|
||||
{areacode: "345", state: "Cayman Islands"},
|
||||
{areacode: "347", state: "New York"},
|
||||
{areacode: "351", state: "Massachusetts"},
|
||||
|
||||
{areacode: "352", state: "Florida"},
|
||||
{areacode: "360", state: "Washington"},
|
||||
{areacode: "361", state: "Texas"},
|
||||
{areacode: "386", state: "Florida"},
|
||||
{areacode: "401", state: "Rhode Island"},
|
||||
{areacode: "402", state: "Nebraska"},
|
||||
|
||||
{areacode: "403", state: "Alberta, Canada"},
|
||||
{areacode: "404", state: "Georgia"},
|
||||
{areacode: "405", state: "Oklahoma"},
|
||||
{areacode: "406", state: "Montana"},
|
||||
{areacode: "407", state: "Florida"},
|
||||
{areacode: "408", state: "California"},
|
||||
|
||||
{areacode: "409", state: "Texas"},
|
||||
{areacode: "410", state: "Maryland"},
|
||||
{areacode: "412", state: "Pennsylvania"},
|
||||
{areacode: "413", state: "Massachusetts"},
|
||||
{areacode: "414", state: "Wisconsin"},
|
||||
{areacode: "415", state: "California"},
|
||||
|
||||
{areacode: "416", state: "Ontario, Canada"},
|
||||
{areacode: "417", state: "Missouri"},
|
||||
{areacode: "418", state: "Quebec, Canada"},
|
||||
{areacode: "419", state: "Ohio"},
|
||||
{areacode: "423", state: "Tennessee"},
|
||||
{areacode: "424", state: "California"},
|
||||
|
||||
{areacode: "425", state: "Washington"},
|
||||
{areacode: "434", state: "Virginia"},
|
||||
{areacode: "435", state: "Utah"},
|
||||
{areacode: "440", state: "Ohio"},
|
||||
{areacode: "441", state: "Bermuda"},
|
||||
{areacode: "443", state: "Maryland"},
|
||||
|
||||
{areacode: "445", state: "Pennsylvania"},
|
||||
{areacode: "450", state: "Quebec, Canada"},
|
||||
{areacode: "464", state: "Illinois"},
|
||||
{areacode: "469", state: "Texas"},
|
||||
{areacode: "470", state: "Georgia"},
|
||||
{areacode: "473", state: "Grenada"},
|
||||
|
||||
{areacode: "475", state: "Connecticut"},
|
||||
{areacode: "478", state: "Georgia"},
|
||||
{areacode: "479", state: "Arkansas"},
|
||||
{areacode: "480", state: "Arizona"},
|
||||
{areacode: "484", state: "Pennsylvania"},
|
||||
{areacode: "501", state: "Arkansas"},
|
||||
|
||||
{areacode: "502", state: "Kentucky"},
|
||||
{areacode: "503", state: "Oregon"},
|
||||
{areacode: "504", state: "Louisiana"},
|
||||
{areacode: "505", state: "New Mexico"},
|
||||
{areacode: "506", state: "New Brunswick, Canada"},
|
||||
{areacode: "507", state: "Minnesota"},
|
||||
|
||||
{areacode: "508", state: "Massachusetts"},
|
||||
{areacode: "509", state: "Washington"},
|
||||
{areacode: "510", state: "California"},
|
||||
{areacode: "512", state: "Texas"},
|
||||
{areacode: "513", state: "Ohio"},
|
||||
{areacode: "514", state: "Quebec, Canada"},
|
||||
|
||||
{areacode: "515", state: "Iowa"},
|
||||
{areacode: "516", state: "New York"},
|
||||
{areacode: "517", state: "Michigan"},
|
||||
{areacode: "518", state: "New York"},
|
||||
{areacode: "519", state: "Ontario, Canada"},
|
||||
{areacode: "520", state: "Arizona"},
|
||||
|
||||
{areacode: "530", state: "California"},
|
||||
{areacode: "540", state: "Virginia"},
|
||||
{areacode: "541", state: "Oregon"},
|
||||
{areacode: "551", state: "New Jersey"},
|
||||
{areacode: "557", state: "Missouri"},
|
||||
{areacode: "559", state: "California"},
|
||||
|
||||
{areacode: "561", state: "Florida"},
|
||||
{areacode: "562", state: "California"},
|
||||
{areacode: "563", state: "Iowa"},
|
||||
{areacode: "564", state: "Washington"},
|
||||
{areacode: "567", state: "Ohio"},
|
||||
{areacode: "570", state: "Pennsylvania"},
|
||||
|
||||
{areacode: "571", state: "Virginia"},
|
||||
{areacode: "573", state: "Missouri"},
|
||||
{areacode: "574", state: "Indiana"},
|
||||
{areacode: "580", state: "Oklahoma"},
|
||||
{areacode: "585", state: "New York"},
|
||||
{areacode: "586", state: "Michigan"},
|
||||
|
||||
{areacode: "601", state: "Mississippi"},
|
||||
{areacode: "602", state: "Arizona"},
|
||||
{areacode: "603", state: "New Hampshire"},
|
||||
{areacode: "604", state: "British Columbia, Canada"},
|
||||
{areacode: "605", state: "South Dakota"},
|
||||
{areacode: "606", state: "Kentucky"},
|
||||
|
||||
{areacode: "607", state: "New York"},
|
||||
{areacode: "608", state: "Wisconsin"},
|
||||
{areacode: "609", state: "New Jersey"},
|
||||
{areacode: "610", state: "Pennsylvania"},
|
||||
{areacode: "612", state: "Minnesota"},
|
||||
{areacode: "613", state: "Ontario, Canada"},
|
||||
|
||||
{areacode: "614", state: "Ohio"},
|
||||
{areacode: "615", state: "Tennessee"},
|
||||
{areacode: "616", state: "Michigan"},
|
||||
{areacode: "617", state: "Massachusetts"},
|
||||
{areacode: "618", state: "Illinois"},
|
||||
{areacode: "619", state: "California"},
|
||||
|
||||
{areacode: "620", state: "Kansas"},
|
||||
{areacode: "623", state: "Arizona"},
|
||||
{areacode: "626", state: "California"},
|
||||
{areacode: "630", state: "Illinois"},
|
||||
{areacode: "631", state: "New York"},
|
||||
{areacode: "636", state: "Missouri"},
|
||||
|
||||
{areacode: "641", state: "Iowa"},
|
||||
{areacode: "646", state: "New York"},
|
||||
{areacode: "647", state: "Ontario, Canada"},
|
||||
{areacode: "649", state: "Turks and Caicos Islands"},
|
||||
{areacode: "650", state: "California"},
|
||||
{areacode: "651", state: "Minnesota"},
|
||||
|
||||
{areacode: "660", state: "Missouri"},
|
||||
{areacode: "661", state: "California"},
|
||||
{areacode: "662", state: "Mississippi"},
|
||||
{areacode: "664", state: "Montserrat"},
|
||||
{areacode: "667", state: "Maryland"},
|
||||
{areacode: "670", state: "CNMI"},
|
||||
|
||||
{areacode: "671", state: "Guam"},
|
||||
{areacode: "678", state: "Georgia"},
|
||||
{areacode: "682", state: "Texas"},
|
||||
{areacode: "701", state: "North Dakota"},
|
||||
{areacode: "702", state: "Nevada"},
|
||||
{areacode: "703", state: "Virginia"},
|
||||
|
||||
{areacode: "704", state: "North Carolina"},
|
||||
{areacode: "705", state: "Ontario, Canada"},
|
||||
{areacode: "706", state: "Georgia"},
|
||||
{areacode: "707", state: "California"},
|
||||
{areacode: "708", state: "Illinois"},
|
||||
{areacode: "709", state: "Newfoundland, Canada"},
|
||||
|
||||
{areacode: "712", state: "Iowa"},
|
||||
{areacode: "713", state: "Texas"},
|
||||
{areacode: "714", state: "California"},
|
||||
{areacode: "715", state: "Wisconsin"},
|
||||
{areacode: "716", state: "New York"},
|
||||
{areacode: "717", state: "Pennsylvania"},
|
||||
|
||||
{areacode: "718", state: "New York"},
|
||||
{areacode: "719", state: "Colorado"},
|
||||
{areacode: "720", state: "Colorado"},
|
||||
{areacode: "724", state: "Pennsylvania"},
|
||||
{areacode: "727", state: "Florida"},
|
||||
{areacode: "731", state: "Tennessee"},
|
||||
|
||||
{areacode: "732", state: "New Jersey"},
|
||||
{areacode: "734", state: "Michigan"},
|
||||
{areacode: "737", state: "Texas"},
|
||||
{areacode: "740", state: "Ohio"},
|
||||
{areacode: "754", state: "Florida"},
|
||||
{areacode: "757", state: "Viriginia"},
|
||||
|
||||
{areacode: "758", state: "St. Lucia"},
|
||||
{areacode: "760", state: "California"},
|
||||
{areacode: "763", state: "Minnesota"},
|
||||
{areacode: "765", state: "Indiana"},
|
||||
{areacode: "767", state: "Dominica"},
|
||||
{areacode: "770", state: "Georgia"},
|
||||
|
||||
{areacode: "772", state: "Florida"},
|
||||
{areacode: "773", state: "Illinois"},
|
||||
{areacode: "774", state: "Massachusetts"},
|
||||
{areacode: "775", state: "Nevada"},
|
||||
{areacode: "778", state: "British Columbia, Canada"},
|
||||
{areacode: "780", state: "Alberta, Canada"},
|
||||
|
||||
{areacode: "781", state: "Massachusetts"},
|
||||
{areacode: "784", state: "St. Vincent & Gren."},
|
||||
{areacode: "785", state: "Kansas"},
|
||||
{areacode: "786", state: "Florida"},
|
||||
{areacode: "787", state: "Puerto Rico"},
|
||||
|
||||
{areacode: "801", state: "Utah"},
|
||||
{areacode: "802", state: "Vermont"},
|
||||
{areacode: "803", state: "South Carolina"},
|
||||
{areacode: "804", state: "Virginia"},
|
||||
{areacode: "805", state: "California"},
|
||||
{areacode: "806", state: "Texas"},
|
||||
|
||||
{areacode: "807", state: "Ontario, Canada"},
|
||||
{areacode: "808", state: "Hawaii"},
|
||||
{areacode: "809", state: "Dominican Republic"},
|
||||
{areacode: "810", state: "Michigan"},
|
||||
{areacode: "812", state: "Indiana"},
|
||||
{areacode: "813", state: "Florida"},
|
||||
|
||||
{areacode: "814", state: "Pennsylvania"},
|
||||
{areacode: "815", state: "Illinois"},
|
||||
{areacode: "816", state: "Missouri"},
|
||||
{areacode: "817", state: "Texas"},
|
||||
{areacode: "818", state: "California"},
|
||||
{areacode: "819", state: "Quebec, Canada"},
|
||||
|
||||
{areacode: "828", state: "North Carolina"},
|
||||
{areacode: "830", state: "Texas"},
|
||||
{areacode: "831", state: "California"},
|
||||
{areacode: "832", state: "Texas"},
|
||||
{areacode: "835", state: "Pennsylvania"},
|
||||
{areacode: "843", state: "South Carolina"},
|
||||
|
||||
{areacode: "845", state: "New York"},
|
||||
{areacode: "847", state: "Illinois"},
|
||||
{areacode: "848", state: "New Jersey"},
|
||||
{areacode: "850", state: "Florida"},
|
||||
{areacode: "856", state: "New Jersey"},
|
||||
{areacode: "857", state: "Massachusetts"},
|
||||
|
||||
{areacode: "858", state: "California"},
|
||||
{areacode: "859", state: "Kentucky"},
|
||||
{areacode: "860", state: "Connecticut"},
|
||||
{areacode: "862", state: "New Jersey"},
|
||||
{areacode: "863", state: "Florida"},
|
||||
{areacode: "864", state: "South Carolina"},
|
||||
|
||||
{areacode: "865", state: "Tennessee"},
|
||||
{areacode: "867", state: "Yukon, NW Territories, Canada"},
|
||||
{areacode: "868", state: "Trinidad and Tobago"},
|
||||
{areacode: "869", state: "St. Kitts & Nevis"},
|
||||
{areacode: "870", state: "Arkansas"},
|
||||
|
||||
{areacode: "872", state: "Illinois"},
|
||||
{areacode: "876", state: "Jamaica"},
|
||||
{areacode: "878", state: "Pennsylvania"},
|
||||
{areacode: "901", state: "Tennessee"},
|
||||
{areacode: "902", state: "Nova Scotia, Canada"},
|
||||
{areacode: "903", state: "Texas"},
|
||||
|
||||
{areacode: "904", state: "Florida"},
|
||||
{areacode: "905", state: "Ontario, Canada"},
|
||||
{areacode: "906", state: "Michigan"},
|
||||
{areacode: "907", state: "Alaska"},
|
||||
{areacode: "908", state: "New Jersey"},
|
||||
{areacode: "909", state: "California"},
|
||||
|
||||
{areacode: "910", state: "North Carolina"},
|
||||
{areacode: "912", state: "Georgia"},
|
||||
{areacode: "913", state: "Kansas"},
|
||||
{areacode: "914", state: "New York"},
|
||||
{areacode: "915", state: "Texas"},
|
||||
{areacode: "916", state: "California"},
|
||||
|
||||
{areacode: "917", state: "New York"},
|
||||
{areacode: "918", state: "Oklahoma"},
|
||||
{areacode: "919", state: "North Carolina"},
|
||||
{areacode: "920", state: "Wisconsin"},
|
||||
{areacode: "925", state: "California"},
|
||||
{areacode: "928", state: "Arizona"},
|
||||
|
||||
{areacode: "931", state: "Tennessee"},
|
||||
{areacode: "936", state: "Texas"},
|
||||
{areacode: "937", state: "Ohio"},
|
||||
{areacode: "939", state: "Puerto Rico"},
|
||||
{areacode: "940", state: "Texas"},
|
||||
{areacode: "941", state: "Florida"},
|
||||
|
||||
{areacode: "947", state: "Michigan"},
|
||||
{areacode: "949", state: "California"},
|
||||
{areacode: "952", state: "Minnesota"},
|
||||
{areacode: "954", state: "Florida"},
|
||||
{areacode: "956", state: "Texas"},
|
||||
{areacode: "959", state: "Connecticut"},
|
||||
|
||||
{areacode: "970", state: "Colorado"},
|
||||
{areacode: "971", state: "Oregon"},
|
||||
{areacode: "972", state: "Texas"},
|
||||
{areacode: "973", state: "New Jersey"},
|
||||
{areacode: "975", state: "Missouri"},
|
||||
{areacode: "978", state: "Massachusetts"},
|
||||
|
||||
{areacode: "979", state: "Texas"},
|
||||
{areacode: "980", state: "North Carolina"},
|
||||
{areacode: "984", state: "North Carolina"},
|
||||
{areacode: "985", state: "Louisiana"},
|
||||
{areacode: "989", state: "Michigan"}
|
||||
]
|
||||
};
|
||||
YAHOO.example.Data = {
|
||||
apitester: [
|
||||
{number:0, date:new Date(1999, 1, 1), string:"1"},
|
||||
{number:1, date:new Date(1999, 10, 10), string:"12"},
|
||||
{number:2, date:new Date(2000, 1, 1), string:"123"},
|
||||
{number:3, date:new Date(2000, 10, 1), string:"10"},
|
||||
{number:4, date:new Date(2001, 10, 12), string:"1"},
|
||||
{number:5, date:new Date(2001, 1, 12), string:"123"},
|
||||
{number:6, date:new Date(2001, 10, 1), string:"11"},
|
||||
{number:7, date:new Date(2001, 10, 1), string:"16"},
|
||||
{number:8, date:new Date(2001, 10, 1), string:"8"},
|
||||
{number:9, date:new Date(2001, 10, 1), string:"6"},
|
||||
{number:10, date:new Date(2001, 10, 1), string:"66"},
|
||||
{number:11, date:new Date(2001, 10, 1), string:"111"},
|
||||
{number:12, date:new Date(2001, 10, 1), string:"110"}
|
||||
],
|
||||
|
||||
multitypes: {
|
||||
items: [
|
||||
{field1: "bananas", field2:new Date(2007, 1, 1), field3:111, field4:"23.4", field5:"bob", field6:"http://www.yahoo.com"},
|
||||
{field1: "cherries", field2:new Date(2006, 1, 1), field3:12.3, field4:"35.12", field5:"ann", field6:"http://www.yahoo.com"},
|
||||
{field1: "apples", field2:new Date(2007, 11, 1), field3:1, field4:34.12, field5:"charlie", field6:"http://www.yahoo.com"},
|
||||
{field1: "bananas", field2:new Date(2007, 1, 11), field3:1112, field4:"03", field5:"diane", field6:"http://www.yahoo.com"},
|
||||
{field1: "cherries", field2:new Date(1999, 1, 11), field3:124, field4:03, field5:"edgar", field6:"http://www.yahoo.com"},
|
||||
{field1: "bananas", field2:"January 10, 2005", field3:"12", field4:"34", field5:"francine", field6:"http://www.yahoo.com"},
|
||||
{field1: "apples", field2:"January 1, 2005", field3:"19.1", field4:"234.5", field5:"george", field6:"http://www.yahoo.com"},
|
||||
{field1: "bananas", field2:"1/11/05", field3:"10.02", field4:"345.654", field5:"hannah", field6:"http://www.yahoo.com"},
|
||||
{field1: "cherries", field2:"1/11/2005", field3:"109", field4:23.456, field5:"igor", field6:"http://www.yahoo.com"},
|
||||
{field1: "bananas", field2:"November 1, 2005", field3:"11111", field4:23.0123, field5:"julie", field6:"http://www.yahoo.com"}
|
||||
]
|
||||
},
|
||||
|
||||
webstats: [
|
||||
["home.html",20,400,44,657],
|
||||
["blog.html",24,377,97,567],
|
||||
["contact.html",32,548,42,543],
|
||||
["about.html",8,465,12,946],
|
||||
["pagenotfound.html",0,0,0,0]
|
||||
],
|
||||
|
||||
emails: {
|
||||
account:"jenny@yahoo.com",
|
||||
currStorage: 10,
|
||||
maxStorage: 200,
|
||||
messages: [
|
||||
{XID: "9897",Date:new Date(1981, 2, 24),To:"Joe",From:"Jenny",Unread:false,Subject:"Check out my new pictures"},
|
||||
{XID: "7899",Date:new Date(1980, 1, 11),To:"Jane",From:"Jenny",Unread:false,Subject:"Let's have lunch"},
|
||||
{XID: "6789",Date:new Date(1978, 11, 12),To:"Ann",From:"Jenny",Unread:false,Subject:"Here's the info you requested"},
|
||||
{XID: "4996",Date:new Date(1974, 1, 11),To:"Bob",From:"Jenny",Unread:true,Subject:"RE: Let's have lunch"},
|
||||
{XID: "4544",Date:new Date(1974, 1, 10),To:"Charlie",From:"Jenny",Unread:false,Subject:"Birthday party Saturday"}
|
||||
]
|
||||
},
|
||||
|
||||
inventory: [
|
||||
{SKU:"23-23874", Quantity:43, Item:"Helmet", Description:"Red baseball helmet. Size: Large."},
|
||||
{SKU:"48-38835", Quantity:84, Item:"Football", Description:"Leather football."},
|
||||
{SKU:"84-84848", Quantity:31, Item:"Goggles", Description:"Light blue swim goggles"},
|
||||
{SKU:"84-84843", Quantity:56, Item:"Badminton Set", Description:"Set of 2 badminton rackets, net, and 3 birdies."},
|
||||
{SKU:"84-39321", Quantity:128, Item:"Tennis Balls", Description:"Canister of 3 tennis balls."},
|
||||
{SKU:"39-48949", Quantity:55, Item:"Snowboard", Description:""},
|
||||
{SKU:"99-28128", Quantity:77, Item:"Cleats", Description:"Soccer cleats. Size: 10."},
|
||||
{SKU:"83-48281", Quantity:65, Item:"Volleyball", Description:""},
|
||||
{SKU:"89-32811", Quantity:12, Item:"Sweatband", Description:"Blue sweatband. Size: Medium."},
|
||||
{SKU:"28-22847", Quantity:43, Item:"Golf Set", Description:"Set of 9 golf clubs and bag."},
|
||||
{SKU:"38-38281", Quantity:1, Item:"Basketball Shorts", Description:"Green basketball shorts. Size: Small."},
|
||||
{SKU:"82-38333", Quantity:288, Item:"Lip balm", Description:"Lip balm. Flavor: Cherry."},
|
||||
{SKU:"21-38485", Quantity:177, Item:"Ping Pong Ball", Description:""},
|
||||
{SKU:"83-38285", Quantity:87, Item:"Hockey Puck", Description:"Glow-in-the-dark hockey puck."}
|
||||
],
|
||||
|
||||
addresses: [
|
||||
{name:"John A. Smith", address:"1236 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan B. Jones", address:"3271 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob C. Uncle", address:"9996 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John D. Smith", address:"1623 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan E. Jones", address:"3217 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob F. Uncle", address:"9899 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John G. Smith", address:"1723 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan H. Jones", address:"3241 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob I. Uncle", address:"9909 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John J. Smith", address:"1623 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan K. Jones", address:"3721 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob L. Uncle", address:"9989 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John M. Smith", address:"1293 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan N. Jones", address:"3621 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob O. Uncle", address:"9959 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"},
|
||||
{name:"John P. Smith", address:"6123 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], last_login:"4/19/2007"},
|
||||
{name:"Joan Q. Jones", address:"3281 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], last_login:"2/15/2006"},
|
||||
{name:"Bob R. Uncle", address:"9989 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], last_login:"1/23/2004"}
|
||||
],
|
||||
|
||||
bookorders: [
|
||||
{id:"po-0167", date:new Date(1980, 2, 24), quantity:1, amount:4, title:"A Book About Nothing",
|
||||
description: "Lorem ipsum dolor sit amet consectetuer Quisque ipsum suscipit Aenean ligula. Accumsan molestie nibh dui orci vitae auctor nec pulvinar ligula elit."},
|
||||
{id:"po-0783", date:new Date("January 3, 1983"), quantity:null, amount:12.12345, title:"The Meaning of Life",
|
||||
description: "Vestibulum scelerisque wisi adipiscing turpis odio Phasellus euismod id orci tristique. Hendrerit sem dictum volutpat cursus pretium dui vitae tincidunt Vivamus Aenean."},
|
||||
{id:"po-0297", date:new Date(1978, 11, 12), quantity:12, amount:1.25, title:"This Book Was Meant to Be Read Aloud",
|
||||
description: "Malesuada pellentesque nibh magna nisl tincidunt wisi dui Nam nunc convallis. Adipiscing leo augue Nulla tellus nec eros metus cursus pretium Sed."},
|
||||
{id:"po-1482", date:new Date("March 11, 1985"), quantity:6, amount:3.5, title:"Read Me Twice",
|
||||
description: "Libero justo pede nibh tincidunt ut tempus metus et Vestibulum vel. Sem justo morbi lacinia dui turpis In Lorem dictumst volutpat cursus."}
|
||||
],
|
||||
|
||||
stateAbbrs: [
|
||||
"AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI",
|
||||
"ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS",
|
||||
"MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR",
|
||||
"PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"
|
||||
],
|
||||
|
||||
areacodes: [
|
||||
{areacode: "201", state: "New Jersey"},
|
||||
{areacode: "202", state: "Washington, DC"},
|
||||
{areacode: "203", state: "Connecticut"},
|
||||
{areacode: "204", state: "Manitoba, Canada"},
|
||||
{areacode: "205", state: "Alabama"},
|
||||
{areacode: "206", state: "Washington"},
|
||||
{areacode: "207", state: "Maine"},
|
||||
|
||||
{areacode: "208", state: "Idaho"},
|
||||
{areacode: "209", state: "California"},
|
||||
{areacode: "210", state: "Texas"},
|
||||
{areacode: "212", state: "New York"},
|
||||
{areacode: "213", state: "California"},
|
||||
{areacode: "214", state: "Texas"},
|
||||
|
||||
{areacode: "215", state: "Pennsylvania"},
|
||||
{areacode: "216", state: "Ohio"},
|
||||
{areacode: "217", state: "Illinois"},
|
||||
{areacode: "218", state: "Minnesota"},
|
||||
{areacode: "219", state: "Indiana"},
|
||||
{areacode: "224", state: "Illinois"},
|
||||
|
||||
{areacode: "225", state: "Louisiana"},
|
||||
{areacode: "227", state: "Maryland"},
|
||||
{areacode: "228", state: "Mississippi"},
|
||||
{areacode: "229", state: "Georgia"},
|
||||
{areacode: "231", state: "Michigan"},
|
||||
{areacode: "234", state: "Ohio"},
|
||||
|
||||
{areacode: "239", state: "Florida"},
|
||||
{areacode: "240", state: "Maryland"},
|
||||
{areacode: "242", state: "Bahamas"},
|
||||
{areacode: "246", state: "Barbados"},
|
||||
{areacode: "248", state: "Michigan"},
|
||||
{areacode: "250", state: "British Columbia"},
|
||||
|
||||
{areacode: "251", state: "Alabama"},
|
||||
{areacode: "252", state: "North Carolina"},
|
||||
{areacode: "253", state: "Washington"},
|
||||
{areacode: "254", state: "Texas"},
|
||||
{areacode: "256", state: "Alabama"},
|
||||
{areacode: "260", state: "Indiana"},
|
||||
|
||||
{areacode: "262", state: "Wisconsin"},
|
||||
{areacode: "264", state: "Anguilla"},
|
||||
{areacode: "267", state: "Pennsylvania"},
|
||||
{areacode: "268", state: "Antigua and Barbuda"},
|
||||
{areacode: "269", state: "Michigan"},
|
||||
{areacode: "270", state: "Kentucky"},
|
||||
|
||||
{areacode: "276", state: "Virginia"},
|
||||
{areacode: "281", state: "Texas"},
|
||||
{areacode: "283", state: "Ohio"},
|
||||
{areacode: "284", state: "British Virgin Islands"},
|
||||
{areacode: "289", state: "Ontario"},
|
||||
{areacode: "301", state: "Maryland"},
|
||||
|
||||
{areacode: "302", state: "Delaware"},
|
||||
{areacode: "303", state: "Colorado"},
|
||||
{areacode: "304", state: "West Virginia"},
|
||||
{areacode: "305", state: "Florida"},
|
||||
{areacode: "306", state: "Saskatchewan, Canada"},
|
||||
{areacode: "307", state: "Wyoming"},
|
||||
|
||||
{areacode: "308", state: "Nebraska"},
|
||||
{areacode: "309", state: "Illinois"},
|
||||
{areacode: "310", state: "California"},
|
||||
{areacode: "312", state: "Illinois"},
|
||||
{areacode: "313", state: "Michigan"},
|
||||
{areacode: "314", state: "Missouri"},
|
||||
|
||||
{areacode: "315", state: "New York"},
|
||||
{areacode: "316", state: "Kansas"},
|
||||
{areacode: "317", state: "Indiana"},
|
||||
{areacode: "318", state: "Louisiana"},
|
||||
{areacode: "319", state: "Iowa"},
|
||||
{areacode: "320", state: "Minnesota"},
|
||||
|
||||
{areacode: "321", state: "Florida"},
|
||||
{areacode: "323", state: "California"},
|
||||
{areacode: "330", state: "Ohio"},
|
||||
{areacode: "331", state: "Illinois"},
|
||||
{areacode: "334", state: "Alabama"},
|
||||
{areacode: "336", state: "North Carolina"},
|
||||
|
||||
{areacode: "337", state: "Louisiana"},
|
||||
{areacode: "339", state: "Massachusetts"},
|
||||
{areacode: "340", state: "US Virgin Islands"},
|
||||
{areacode: "345", state: "Cayman Islands"},
|
||||
{areacode: "347", state: "New York"},
|
||||
{areacode: "351", state: "Massachusetts"},
|
||||
|
||||
{areacode: "352", state: "Florida"},
|
||||
{areacode: "360", state: "Washington"},
|
||||
{areacode: "361", state: "Texas"},
|
||||
{areacode: "386", state: "Florida"},
|
||||
{areacode: "401", state: "Rhode Island"},
|
||||
{areacode: "402", state: "Nebraska"},
|
||||
|
||||
{areacode: "403", state: "Alberta, Canada"},
|
||||
{areacode: "404", state: "Georgia"},
|
||||
{areacode: "405", state: "Oklahoma"},
|
||||
{areacode: "406", state: "Montana"},
|
||||
{areacode: "407", state: "Florida"},
|
||||
{areacode: "408", state: "California"},
|
||||
|
||||
{areacode: "409", state: "Texas"},
|
||||
{areacode: "410", state: "Maryland"},
|
||||
{areacode: "412", state: "Pennsylvania"},
|
||||
{areacode: "413", state: "Massachusetts"},
|
||||
{areacode: "414", state: "Wisconsin"},
|
||||
{areacode: "415", state: "California"},
|
||||
|
||||
{areacode: "416", state: "Ontario, Canada"},
|
||||
{areacode: "417", state: "Missouri"},
|
||||
{areacode: "418", state: "Quebec, Canada"},
|
||||
{areacode: "419", state: "Ohio"},
|
||||
{areacode: "423", state: "Tennessee"},
|
||||
{areacode: "424", state: "California"},
|
||||
|
||||
{areacode: "425", state: "Washington"},
|
||||
{areacode: "434", state: "Virginia"},
|
||||
{areacode: "435", state: "Utah"},
|
||||
{areacode: "440", state: "Ohio"},
|
||||
{areacode: "441", state: "Bermuda"},
|
||||
{areacode: "443", state: "Maryland"},
|
||||
|
||||
{areacode: "445", state: "Pennsylvania"},
|
||||
{areacode: "450", state: "Quebec, Canada"},
|
||||
{areacode: "464", state: "Illinois"},
|
||||
{areacode: "469", state: "Texas"},
|
||||
{areacode: "470", state: "Georgia"},
|
||||
{areacode: "473", state: "Grenada"},
|
||||
|
||||
{areacode: "475", state: "Connecticut"},
|
||||
{areacode: "478", state: "Georgia"},
|
||||
{areacode: "479", state: "Arkansas"},
|
||||
{areacode: "480", state: "Arizona"},
|
||||
{areacode: "484", state: "Pennsylvania"},
|
||||
{areacode: "501", state: "Arkansas"},
|
||||
|
||||
{areacode: "502", state: "Kentucky"},
|
||||
{areacode: "503", state: "Oregon"},
|
||||
{areacode: "504", state: "Louisiana"},
|
||||
{areacode: "505", state: "New Mexico"},
|
||||
{areacode: "506", state: "New Brunswick, Canada"},
|
||||
{areacode: "507", state: "Minnesota"},
|
||||
|
||||
{areacode: "508", state: "Massachusetts"},
|
||||
{areacode: "509", state: "Washington"},
|
||||
{areacode: "510", state: "California"},
|
||||
{areacode: "512", state: "Texas"},
|
||||
{areacode: "513", state: "Ohio"},
|
||||
{areacode: "514", state: "Quebec, Canada"},
|
||||
|
||||
{areacode: "515", state: "Iowa"},
|
||||
{areacode: "516", state: "New York"},
|
||||
{areacode: "517", state: "Michigan"},
|
||||
{areacode: "518", state: "New York"},
|
||||
{areacode: "519", state: "Ontario, Canada"},
|
||||
{areacode: "520", state: "Arizona"},
|
||||
|
||||
{areacode: "530", state: "California"},
|
||||
{areacode: "540", state: "Virginia"},
|
||||
{areacode: "541", state: "Oregon"},
|
||||
{areacode: "551", state: "New Jersey"},
|
||||
{areacode: "557", state: "Missouri"},
|
||||
{areacode: "559", state: "California"},
|
||||
|
||||
{areacode: "561", state: "Florida"},
|
||||
{areacode: "562", state: "California"},
|
||||
{areacode: "563", state: "Iowa"},
|
||||
{areacode: "564", state: "Washington"},
|
||||
{areacode: "567", state: "Ohio"},
|
||||
{areacode: "570", state: "Pennsylvania"},
|
||||
|
||||
{areacode: "571", state: "Virginia"},
|
||||
{areacode: "573", state: "Missouri"},
|
||||
{areacode: "574", state: "Indiana"},
|
||||
{areacode: "580", state: "Oklahoma"},
|
||||
{areacode: "585", state: "New York"},
|
||||
{areacode: "586", state: "Michigan"},
|
||||
|
||||
{areacode: "601", state: "Mississippi"},
|
||||
{areacode: "602", state: "Arizona"},
|
||||
{areacode: "603", state: "New Hampshire"},
|
||||
{areacode: "604", state: "British Columbia, Canada"},
|
||||
{areacode: "605", state: "South Dakota"},
|
||||
{areacode: "606", state: "Kentucky"},
|
||||
|
||||
{areacode: "607", state: "New York"},
|
||||
{areacode: "608", state: "Wisconsin"},
|
||||
{areacode: "609", state: "New Jersey"},
|
||||
{areacode: "610", state: "Pennsylvania"},
|
||||
{areacode: "612", state: "Minnesota"},
|
||||
{areacode: "613", state: "Ontario, Canada"},
|
||||
|
||||
{areacode: "614", state: "Ohio"},
|
||||
{areacode: "615", state: "Tennessee"},
|
||||
{areacode: "616", state: "Michigan"},
|
||||
{areacode: "617", state: "Massachusetts"},
|
||||
{areacode: "618", state: "Illinois"},
|
||||
{areacode: "619", state: "California"},
|
||||
|
||||
{areacode: "620", state: "Kansas"},
|
||||
{areacode: "623", state: "Arizona"},
|
||||
{areacode: "626", state: "California"},
|
||||
{areacode: "630", state: "Illinois"},
|
||||
{areacode: "631", state: "New York"},
|
||||
{areacode: "636", state: "Missouri"},
|
||||
|
||||
{areacode: "641", state: "Iowa"},
|
||||
{areacode: "646", state: "New York"},
|
||||
{areacode: "647", state: "Ontario, Canada"},
|
||||
{areacode: "649", state: "Turks and Caicos Islands"},
|
||||
{areacode: "650", state: "California"},
|
||||
{areacode: "651", state: "Minnesota"},
|
||||
|
||||
{areacode: "660", state: "Missouri"},
|
||||
{areacode: "661", state: "California"},
|
||||
{areacode: "662", state: "Mississippi"},
|
||||
{areacode: "664", state: "Montserrat"},
|
||||
{areacode: "667", state: "Maryland"},
|
||||
{areacode: "670", state: "CNMI"},
|
||||
|
||||
{areacode: "671", state: "Guam"},
|
||||
{areacode: "678", state: "Georgia"},
|
||||
{areacode: "682", state: "Texas"},
|
||||
{areacode: "701", state: "North Dakota"},
|
||||
{areacode: "702", state: "Nevada"},
|
||||
{areacode: "703", state: "Virginia"},
|
||||
|
||||
{areacode: "704", state: "North Carolina"},
|
||||
{areacode: "705", state: "Ontario, Canada"},
|
||||
{areacode: "706", state: "Georgia"},
|
||||
{areacode: "707", state: "California"},
|
||||
{areacode: "708", state: "Illinois"},
|
||||
{areacode: "709", state: "Newfoundland, Canada"},
|
||||
|
||||
{areacode: "712", state: "Iowa"},
|
||||
{areacode: "713", state: "Texas"},
|
||||
{areacode: "714", state: "California"},
|
||||
{areacode: "715", state: "Wisconsin"},
|
||||
{areacode: "716", state: "New York"},
|
||||
{areacode: "717", state: "Pennsylvania"},
|
||||
|
||||
{areacode: "718", state: "New York"},
|
||||
{areacode: "719", state: "Colorado"},
|
||||
{areacode: "720", state: "Colorado"},
|
||||
{areacode: "724", state: "Pennsylvania"},
|
||||
{areacode: "727", state: "Florida"},
|
||||
{areacode: "731", state: "Tennessee"},
|
||||
|
||||
{areacode: "732", state: "New Jersey"},
|
||||
{areacode: "734", state: "Michigan"},
|
||||
{areacode: "737", state: "Texas"},
|
||||
{areacode: "740", state: "Ohio"},
|
||||
{areacode: "754", state: "Florida"},
|
||||
{areacode: "757", state: "Viriginia"},
|
||||
|
||||
{areacode: "758", state: "St. Lucia"},
|
||||
{areacode: "760", state: "California"},
|
||||
{areacode: "763", state: "Minnesota"},
|
||||
{areacode: "765", state: "Indiana"},
|
||||
{areacode: "767", state: "Dominica"},
|
||||
{areacode: "770", state: "Georgia"},
|
||||
|
||||
{areacode: "772", state: "Florida"},
|
||||
{areacode: "773", state: "Illinois"},
|
||||
{areacode: "774", state: "Massachusetts"},
|
||||
{areacode: "775", state: "Nevada"},
|
||||
{areacode: "778", state: "British Columbia, Canada"},
|
||||
{areacode: "780", state: "Alberta, Canada"},
|
||||
|
||||
{areacode: "781", state: "Massachusetts"},
|
||||
{areacode: "784", state: "St. Vincent & Gren."},
|
||||
{areacode: "785", state: "Kansas"},
|
||||
{areacode: "786", state: "Florida"},
|
||||
{areacode: "787", state: "Puerto Rico"},
|
||||
|
||||
{areacode: "801", state: "Utah"},
|
||||
{areacode: "802", state: "Vermont"},
|
||||
{areacode: "803", state: "South Carolina"},
|
||||
{areacode: "804", state: "Virginia"},
|
||||
{areacode: "805", state: "California"},
|
||||
{areacode: "806", state: "Texas"},
|
||||
|
||||
{areacode: "807", state: "Ontario, Canada"},
|
||||
{areacode: "808", state: "Hawaii"},
|
||||
{areacode: "809", state: "Dominican Republic"},
|
||||
{areacode: "810", state: "Michigan"},
|
||||
{areacode: "812", state: "Indiana"},
|
||||
{areacode: "813", state: "Florida"},
|
||||
|
||||
{areacode: "814", state: "Pennsylvania"},
|
||||
{areacode: "815", state: "Illinois"},
|
||||
{areacode: "816", state: "Missouri"},
|
||||
{areacode: "817", state: "Texas"},
|
||||
{areacode: "818", state: "California"},
|
||||
{areacode: "819", state: "Quebec, Canada"},
|
||||
|
||||
{areacode: "828", state: "North Carolina"},
|
||||
{areacode: "830", state: "Texas"},
|
||||
{areacode: "831", state: "California"},
|
||||
{areacode: "832", state: "Texas"},
|
||||
{areacode: "835", state: "Pennsylvania"},
|
||||
{areacode: "843", state: "South Carolina"},
|
||||
|
||||
{areacode: "845", state: "New York"},
|
||||
{areacode: "847", state: "Illinois"},
|
||||
{areacode: "848", state: "New Jersey"},
|
||||
{areacode: "850", state: "Florida"},
|
||||
{areacode: "856", state: "New Jersey"},
|
||||
{areacode: "857", state: "Massachusetts"},
|
||||
|
||||
{areacode: "858", state: "California"},
|
||||
{areacode: "859", state: "Kentucky"},
|
||||
{areacode: "860", state: "Connecticut"},
|
||||
{areacode: "862", state: "New Jersey"},
|
||||
{areacode: "863", state: "Florida"},
|
||||
{areacode: "864", state: "South Carolina"},
|
||||
|
||||
{areacode: "865", state: "Tennessee"},
|
||||
{areacode: "867", state: "Yukon, NW Territories, Canada"},
|
||||
{areacode: "868", state: "Trinidad and Tobago"},
|
||||
{areacode: "869", state: "St. Kitts & Nevis"},
|
||||
{areacode: "870", state: "Arkansas"},
|
||||
|
||||
{areacode: "872", state: "Illinois"},
|
||||
{areacode: "876", state: "Jamaica"},
|
||||
{areacode: "878", state: "Pennsylvania"},
|
||||
{areacode: "901", state: "Tennessee"},
|
||||
{areacode: "902", state: "Nova Scotia, Canada"},
|
||||
{areacode: "903", state: "Texas"},
|
||||
|
||||
{areacode: "904", state: "Florida"},
|
||||
{areacode: "905", state: "Ontario, Canada"},
|
||||
{areacode: "906", state: "Michigan"},
|
||||
{areacode: "907", state: "Alaska"},
|
||||
{areacode: "908", state: "New Jersey"},
|
||||
{areacode: "909", state: "California"},
|
||||
|
||||
{areacode: "910", state: "North Carolina"},
|
||||
{areacode: "912", state: "Georgia"},
|
||||
{areacode: "913", state: "Kansas"},
|
||||
{areacode: "914", state: "New York"},
|
||||
{areacode: "915", state: "Texas"},
|
||||
{areacode: "916", state: "California"},
|
||||
|
||||
{areacode: "917", state: "New York"},
|
||||
{areacode: "918", state: "Oklahoma"},
|
||||
{areacode: "919", state: "North Carolina"},
|
||||
{areacode: "920", state: "Wisconsin"},
|
||||
{areacode: "925", state: "California"},
|
||||
{areacode: "928", state: "Arizona"},
|
||||
|
||||
{areacode: "931", state: "Tennessee"},
|
||||
{areacode: "936", state: "Texas"},
|
||||
{areacode: "937", state: "Ohio"},
|
||||
{areacode: "939", state: "Puerto Rico"},
|
||||
{areacode: "940", state: "Texas"},
|
||||
{areacode: "941", state: "Florida"},
|
||||
|
||||
{areacode: "947", state: "Michigan"},
|
||||
{areacode: "949", state: "California"},
|
||||
{areacode: "952", state: "Minnesota"},
|
||||
{areacode: "954", state: "Florida"},
|
||||
{areacode: "956", state: "Texas"},
|
||||
{areacode: "959", state: "Connecticut"},
|
||||
|
||||
{areacode: "970", state: "Colorado"},
|
||||
{areacode: "971", state: "Oregon"},
|
||||
{areacode: "972", state: "Texas"},
|
||||
{areacode: "973", state: "New Jersey"},
|
||||
{areacode: "975", state: "Missouri"},
|
||||
{areacode: "978", state: "Massachusetts"},
|
||||
|
||||
{areacode: "979", state: "Texas"},
|
||||
{areacode: "980", state: "North Carolina"},
|
||||
{areacode: "984", state: "North Carolina"},
|
||||
{areacode: "985", state: "Louisiana"},
|
||||
{areacode: "989", state: "Michigan"}
|
||||
]
|
||||
};
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
include('state_data.php');
|
||||
include('state_cols.php');
|
||||
|
||||
if (!isset($_REQUEST['startIndex']) or intval($_REQUEST['startIndex']) < 1) {
|
||||
$startIndex = 0;
|
||||
} else {
|
||||
$startIndex = intval($_REQUEST['startIndex']);
|
||||
}
|
||||
if (!isset($_REQUEST['results']) or intval($_REQUEST['results']) < 10) {
|
||||
$results = 10;
|
||||
} else {
|
||||
$results = intval($_REQUEST['results']);
|
||||
$results = $results > 35 ? 35 : $results;
|
||||
}
|
||||
if (!isset($_REQUEST['state']) or !is_array($_REQUEST['state'])) {
|
||||
$state = array();
|
||||
} else {
|
||||
$state = $_REQUEST['state'];
|
||||
}
|
||||
if (!isset($_REQUEST['gender']) or !in_array($_REQUEST['gender'], array('Both', 'Female', 'Male'), true)) {
|
||||
$gender = 'Both';
|
||||
} else {
|
||||
$gender = $_REQUEST['gender'];
|
||||
}
|
||||
|
||||
$state_data = array_intersect_key($state_data, array_flip($state));
|
||||
|
||||
$return = array();
|
||||
foreach ($state_cols as $key => $name) {
|
||||
if ($gender !== 'Both') {
|
||||
if (!strpos($name, $gender)) {
|
||||
unset($state_cols[$key]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$return[] = array(
|
||||
'name' => $name,
|
||||
'state1' => isset($state[1]) && isset($state_data[$state[1]][$key]) ? $state_data[$state[1]][$key] : '',
|
||||
'state2' => isset($state[2]) && isset($state_data[$state[2]][$key]) ? $state_data[$state[2]][$key] : '',
|
||||
'state3' => isset($state[3]) && isset($state_data[$state[3]][$key]) ? $state_data[$state[3]][$key] : '',
|
||||
);
|
||||
}
|
||||
|
||||
$return = array_slice($return, $startIndex, $results);
|
||||
|
||||
//var_export($return);
|
||||
echo json_encode(array(
|
||||
"recordsReturned" => count($return),
|
||||
"totalRecords" => count($state_cols),
|
||||
"startIndex" => $startIndex,
|
||||
"records" => $return
|
||||
));
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,10 @@
|
|||
Domino's Pizza|615 Caliente Dr|Sunnyvale|(408) 732-3030|4|http://local.yahoo.com/details?id=21335892&stx=pizza&csz=Sunnyvale+CA&ed=17rS8q160Sy5Htog0TF1m1atNv01Iz7ySeGEMtCL4dJsf1ku0nhziD2qN5XcnHlJtDS4IydIbA--
|
||||
Pizza Depot|919 E Duane Ave|Sunnyvale|(408) 245-7760|3.5|http://local.yahoo.com/details?id=21332021&stx=pizza&csz=Sunnyvale+CA&ed=6tiAL6160Sx1XVIEu1zIWPu6fD8rJDV4.offJLNUTb1Ri2Q.R5oLTYvDCz8YmzivI7Bz0gfrpw--
|
||||
Pizza Hut|464 N Mathilda Ave|Sunnyvale|(408) 735-1900|2.5|http://local.yahoo.com/details?id=21340811&stx=pizza&csz=Sunnyvale+CA&ed=syVWvq160Szz0Q60Q8N7uetWGoUIbThLIdulmQLubJ29CuU7wpxDvDxrLF4md791a4jW7kNRr9eSVQ--
|
||||
Giovannis Pizzeria|1127 N Lawrence Expy|Sunnyvale|(408) 734-4221|4.5|http://local.yahoo.com/details?id=21341983&stx=pizza&csz=Sunnyvale+CA&ed=kYc.Ba160SxZddWADEWWMRsGo0KgZ6X22_QAgTZxq3OdfrVCfCdLU9mvvJeybt8XpDhMC58HjElJAiWi
|
||||
Round Table Pizza|415 N Mary Ave|Sunnyvale|(408) 733-1365|5|http://local.yahoo.com/details?id=21329046&stx=pizza&csz=Sunnyvale+CA&ed=OkhHFa160Sx2UXqpaqXDZAGyyKWrCO9wfqP24Mur1nNB2pqgQsi3DQxeSEK_Uj9fxQN4zNax
|
||||
Vitos Famous Pizza|1155 Reed Ave|Sunnyvale|(408) 246-8800|4.5|http://local.yahoo.com/details?id=21332026&stx=pizza&csz=Sunnyvale+CA&ed=QTqeMK160Sx0Mril0Jnu_RK0RF4vTvEspLb2s60hJTic2.RapYE82B6edOm18LAox7KOqkw-
|
||||
Round Table Pizza|101 Town And Countr|Sunnyvale|(408) 736-2242|3|http://local.yahoo.com/details?id=21340803&stx=pizza&csz=Sunnyvale+CA&ed=SiKr2K160SwJxDEvf_eAwROvFMpfCIqsVX3dSyYtvj6HomUPpdS92g9AIoaoZNtg.WNSGcT4hpk1JxxT
|
||||
Round Table Pizza|860 Old San Francisco Rd|Sunnyvale|(408) 245-9000|3|http://local.yahoo.com/details?id=21340791&stx=pizza&csz=Sunnyvale+CA&ed=NF3MAq160SzKHt2S1yk7tJKtIMvbW44yNlckp8Y5veL7w8DWvagJYLH2tGehl1cPcLGbR4kzMTi4cf1U7iP6YA--
|
||||
Domino's Pizza|992 W El Camino Real|Sunnyvale|(408) 736-3666|4|http://local.yahoo.com/details?id=21341882&stx=pizza&csz=Sunnyvale+CA&ed=_tzLZq160SyF.4GddMA07QiACQkYc84nqI0j3hvsAcfMemwlBCiezUltSm8_ppCH1Bo8SlklBj1QhuRp
|
||||
Little Caesars Pizza|1039 Sunnyvale Saratoga Rd|Sunnyvale|(408) 245-0607|3|http://local.yahoo.com/details?id=21330174&stx=pizza&csz=Sunnyvale+CA&ed=89myuK160Syd6uoWQ5fTb6uLid70P.ucvPaBKA92m7bc1aVSW5LGmRbGsSIqT8U5e2eA4Ki4nQHVAAhh5.SVNIAQ
|
||||
Domino's Pizza|615 Caliente Dr|Sunnyvale|(408) 732-3030|4|http://local.yahoo.com/details?id=21335892&stx=pizza&csz=Sunnyvale+CA&ed=17rS8q160Sy5Htog0TF1m1atNv01Iz7ySeGEMtCL4dJsf1ku0nhziD2qN5XcnHlJtDS4IydIbA--
|
||||
Pizza Depot|919 E Duane Ave|Sunnyvale|(408) 245-7760|3.5|http://local.yahoo.com/details?id=21332021&stx=pizza&csz=Sunnyvale+CA&ed=6tiAL6160Sx1XVIEu1zIWPu6fD8rJDV4.offJLNUTb1Ri2Q.R5oLTYvDCz8YmzivI7Bz0gfrpw--
|
||||
Pizza Hut|464 N Mathilda Ave|Sunnyvale|(408) 735-1900|2.5|http://local.yahoo.com/details?id=21340811&stx=pizza&csz=Sunnyvale+CA&ed=syVWvq160Szz0Q60Q8N7uetWGoUIbThLIdulmQLubJ29CuU7wpxDvDxrLF4md791a4jW7kNRr9eSVQ--
|
||||
Giovannis Pizzeria|1127 N Lawrence Expy|Sunnyvale|(408) 734-4221|4.5|http://local.yahoo.com/details?id=21341983&stx=pizza&csz=Sunnyvale+CA&ed=kYc.Ba160SxZddWADEWWMRsGo0KgZ6X22_QAgTZxq3OdfrVCfCdLU9mvvJeybt8XpDhMC58HjElJAiWi
|
||||
Round Table Pizza|415 N Mary Ave|Sunnyvale|(408) 733-1365|5|http://local.yahoo.com/details?id=21329046&stx=pizza&csz=Sunnyvale+CA&ed=OkhHFa160Sx2UXqpaqXDZAGyyKWrCO9wfqP24Mur1nNB2pqgQsi3DQxeSEK_Uj9fxQN4zNax
|
||||
Vitos Famous Pizza|1155 Reed Ave|Sunnyvale|(408) 246-8800|4.5|http://local.yahoo.com/details?id=21332026&stx=pizza&csz=Sunnyvale+CA&ed=QTqeMK160Sx0Mril0Jnu_RK0RF4vTvEspLb2s60hJTic2.RapYE82B6edOm18LAox7KOqkw-
|
||||
Round Table Pizza|101 Town And Countr|Sunnyvale|(408) 736-2242|3|http://local.yahoo.com/details?id=21340803&stx=pizza&csz=Sunnyvale+CA&ed=SiKr2K160SwJxDEvf_eAwROvFMpfCIqsVX3dSyYtvj6HomUPpdS92g9AIoaoZNtg.WNSGcT4hpk1JxxT
|
||||
Round Table Pizza|860 Old San Francisco Rd|Sunnyvale|(408) 245-9000|3|http://local.yahoo.com/details?id=21340791&stx=pizza&csz=Sunnyvale+CA&ed=NF3MAq160SzKHt2S1yk7tJKtIMvbW44yNlckp8Y5veL7w8DWvagJYLH2tGehl1cPcLGbR4kzMTi4cf1U7iP6YA--
|
||||
Domino's Pizza|992 W El Camino Real|Sunnyvale|(408) 736-3666|4|http://local.yahoo.com/details?id=21341882&stx=pizza&csz=Sunnyvale+CA&ed=_tzLZq160SyF.4GddMA07QiACQkYc84nqI0j3hvsAcfMemwlBCiezUltSm8_ppCH1Bo8SlklBj1QhuRp
|
||||
Little Caesars Pizza|1039 Sunnyvale Saratoga Rd|Sunnyvale|(408) 245-0607|3|http://local.yahoo.com/details?id=21330174&stx=pizza&csz=Sunnyvale+CA&ed=89myuK160Syd6uoWQ5fTb6uLid70P.ucvPaBKA92m7bc1aVSW5LGmRbGsSIqT8U5e2eA4Ki4nQHVAAhh5.SVNIAQ
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
Restaurant|Location|Town|Telephone|Stars|Url
|
||||
Domino's Pizza|615 Caliente Dr|Sunnyvale|(408) 732-3030|4|http://local.yahoo.com/details?id=21335892&stx=pizza&csz=Sunnyvale+CA&ed=17rS8q160Sy5Htog0TF1m1atNv01Iz7ySeGEMtCL4dJsf1ku0nhziD2qN5XcnHlJtDS4IydIbA--
|
||||
Pizza Depot|919 E Duane Ave|Sunnyvale|(408) 245-7760|3.5|http://local.yahoo.com/details?id=21332021&stx=pizza&csz=Sunnyvale+CA&ed=6tiAL6160Sx1XVIEu1zIWPu6fD8rJDV4.offJLNUTb1Ri2Q.R5oLTYvDCz8YmzivI7Bz0gfrpw--
|
||||
Pizza Hut|464 N Mathilda Ave|Sunnyvale|(408) 735-1900|2.5|http://local.yahoo.com/details?id=21340811&stx=pizza&csz=Sunnyvale+CA&ed=syVWvq160Szz0Q60Q8N7uetWGoUIbThLIdulmQLubJ29CuU7wpxDvDxrLF4md791a4jW7kNRr9eSVQ--
|
||||
Giovannis Pizzeria|1127 N Lawrence Expy|Sunnyvale|(408) 734-4221|4.5|http://local.yahoo.com/details?id=21341983&stx=pizza&csz=Sunnyvale+CA&ed=kYc.Ba160SxZddWADEWWMRsGo0KgZ6X22_QAgTZxq3OdfrVCfCdLU9mvvJeybt8XpDhMC58HjElJAiWi
|
||||
Round Table Pizza|415 N Mary Ave|Sunnyvale|(408) 733-1365|5|http://local.yahoo.com/details?id=21329046&stx=pizza&csz=Sunnyvale+CA&ed=OkhHFa160Sx2UXqpaqXDZAGyyKWrCO9wfqP24Mur1nNB2pqgQsi3DQxeSEK_Uj9fxQN4zNax
|
||||
Vitos Famous Pizza|1155 Reed Ave|Sunnyvale|(408) 246-8800|4.5|http://local.yahoo.com/details?id=21332026&stx=pizza&csz=Sunnyvale+CA&ed=QTqeMK160Sx0Mril0Jnu_RK0RF4vTvEspLb2s60hJTic2.RapYE82B6edOm18LAox7KOqkw-
|
||||
Round Table Pizza|101 Town And Countr|Sunnyvale|(408) 736-2242|3|http://local.yahoo.com/details?id=21340803&stx=pizza&csz=Sunnyvale+CA&ed=SiKr2K160SwJxDEvf_eAwROvFMpfCIqsVX3dSyYtvj6HomUPpdS92g9AIoaoZNtg.WNSGcT4hpk1JxxT
|
||||
Round Table Pizza|860 Old San Francisco Rd|Sunnyvale|(408) 245-9000|3|http://local.yahoo.com/details?id=21340791&stx=pizza&csz=Sunnyvale+CA&ed=NF3MAq160SzKHt2S1yk7tJKtIMvbW44yNlckp8Y5veL7w8DWvagJYLH2tGehl1cPcLGbR4kzMTi4cf1U7iP6YA--
|
||||
Domino's Pizza|992 W El Camino Real|Sunnyvale|(408) 736-3666|4|http://local.yahoo.com/details?id=21341882&stx=pizza&csz=Sunnyvale+CA&ed=_tzLZq160SyF.4GddMA07QiACQkYc84nqI0j3hvsAcfMemwlBCiezUltSm8_ppCH1Bo8SlklBj1QhuRp
|
||||
Little Caesars Pizza|1039 Sunnyvale Saratoga Rd|Sunnyvale|(408) 245-0607|3|http://local.yahoo.com/details?id=21330174&stx=pizza&csz=Sunnyvale+CA&ed=89myuK160Syd6uoWQ5fTb6uLid70P.ucvPaBKA92m7bc1aVSW5LGmRbGsSIqT8U5e2eA4Ki4nQHVAAhh5.SVNIAQ
|
||||
Restaurant|Location|Town|Telephone|Stars|Url
|
||||
Domino's Pizza|615 Caliente Dr|Sunnyvale|(408) 732-3030|4|http://local.yahoo.com/details?id=21335892&stx=pizza&csz=Sunnyvale+CA&ed=17rS8q160Sy5Htog0TF1m1atNv01Iz7ySeGEMtCL4dJsf1ku0nhziD2qN5XcnHlJtDS4IydIbA--
|
||||
Pizza Depot|919 E Duane Ave|Sunnyvale|(408) 245-7760|3.5|http://local.yahoo.com/details?id=21332021&stx=pizza&csz=Sunnyvale+CA&ed=6tiAL6160Sx1XVIEu1zIWPu6fD8rJDV4.offJLNUTb1Ri2Q.R5oLTYvDCz8YmzivI7Bz0gfrpw--
|
||||
Pizza Hut|464 N Mathilda Ave|Sunnyvale|(408) 735-1900|2.5|http://local.yahoo.com/details?id=21340811&stx=pizza&csz=Sunnyvale+CA&ed=syVWvq160Szz0Q60Q8N7uetWGoUIbThLIdulmQLubJ29CuU7wpxDvDxrLF4md791a4jW7kNRr9eSVQ--
|
||||
Giovannis Pizzeria|1127 N Lawrence Expy|Sunnyvale|(408) 734-4221|4.5|http://local.yahoo.com/details?id=21341983&stx=pizza&csz=Sunnyvale+CA&ed=kYc.Ba160SxZddWADEWWMRsGo0KgZ6X22_QAgTZxq3OdfrVCfCdLU9mvvJeybt8XpDhMC58HjElJAiWi
|
||||
Round Table Pizza|415 N Mary Ave|Sunnyvale|(408) 733-1365|5|http://local.yahoo.com/details?id=21329046&stx=pizza&csz=Sunnyvale+CA&ed=OkhHFa160Sx2UXqpaqXDZAGyyKWrCO9wfqP24Mur1nNB2pqgQsi3DQxeSEK_Uj9fxQN4zNax
|
||||
Vitos Famous Pizza|1155 Reed Ave|Sunnyvale|(408) 246-8800|4.5|http://local.yahoo.com/details?id=21332026&stx=pizza&csz=Sunnyvale+CA&ed=QTqeMK160Sx0Mril0Jnu_RK0RF4vTvEspLb2s60hJTic2.RapYE82B6edOm18LAox7KOqkw-
|
||||
Round Table Pizza|101 Town And Countr|Sunnyvale|(408) 736-2242|3|http://local.yahoo.com/details?id=21340803&stx=pizza&csz=Sunnyvale+CA&ed=SiKr2K160SwJxDEvf_eAwROvFMpfCIqsVX3dSyYtvj6HomUPpdS92g9AIoaoZNtg.WNSGcT4hpk1JxxT
|
||||
Round Table Pizza|860 Old San Francisco Rd|Sunnyvale|(408) 245-9000|3|http://local.yahoo.com/details?id=21340791&stx=pizza&csz=Sunnyvale+CA&ed=NF3MAq160SzKHt2S1yk7tJKtIMvbW44yNlckp8Y5veL7w8DWvagJYLH2tGehl1cPcLGbR4kzMTi4cf1U7iP6YA--
|
||||
Domino's Pizza|992 W El Camino Real|Sunnyvale|(408) 736-3666|4|http://local.yahoo.com/details?id=21341882&stx=pizza&csz=Sunnyvale+CA&ed=_tzLZq160SyF.4GddMA07QiACQkYc84nqI0j3hvsAcfMemwlBCiezUltSm8_ppCH1Bo8SlklBj1QhuRp
|
||||
Little Caesars Pizza|1039 Sunnyvale Saratoga Rd|Sunnyvale|(408) 245-0607|3|http://local.yahoo.com/details?id=21330174&stx=pizza&csz=Sunnyvale+CA&ed=89myuK160Syd6uoWQ5fTb6uLid70P.ucvPaBKA92m7bc1aVSW5LGmRbGsSIqT8U5e2eA4Ki4nQHVAAhh5.SVNIAQ
|
||||
|
|
|
|||
12
www/extras/yui/examples/datatable/assets/php/xml_proxy.php
Normal file
12
www/extras/yui/examples/datatable/assets/php/xml_proxy.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
/* yadl_spaceid - Skip Stamping */
|
||||
|
||||
// Hard-code hostname and path:
|
||||
$response = "<myroot rootatt='5'><top>topvalue</top><second nested='nestedsecond' /><allitems><livehere><item type='foo'><name type='nametype0'>Abc</name><rank>0</rank><subitem><name type='subnametype0'>subABC</name><age>10</age></subitem></item><item type='bar'><name type='nametype1'>Def</name><rank>1</rank><subitem><name type='subnametype1'>subDEF</name><age>11</age></subitem></item><item type='bat'><name type='nametype2'>Ghi</name><rank>2</rank><subitem><name type='subnametype2'>subGHI</name><age>12</age></subitem></item></livehere></allitems></myroot>";
|
||||
|
||||
|
||||
header("Content-Type: text/xml");
|
||||
echo $response;
|
||||
|
||||
?>
|
||||
|
|
@ -1,45 +1,45 @@
|
|||
<?php
|
||||
|
||||
/* yadl_spaceid - Skip Stamping */
|
||||
|
||||
// Yahoo! proxy
|
||||
|
||||
// Hard-code hostname and path:
|
||||
define ('PATH', 'http://local.yahooapis.com/LocalSearchService/V2/localSearch');
|
||||
|
||||
$type = "text/xml";
|
||||
|
||||
// Get all query params
|
||||
$query = "?";
|
||||
foreach ($_GET as $key => $value) {
|
||||
if(($key == "output") && ($value == "json")) {
|
||||
$type = "application/json";
|
||||
}
|
||||
$query .= urlencode($key)."=".urlencode($value)."&";
|
||||
}
|
||||
|
||||
foreach ($_POST as $key => $value) {
|
||||
if(($key == "output") && ($value == "json")) {
|
||||
$type = "application/json";
|
||||
}
|
||||
$query .= $key."=".$value."&";
|
||||
}
|
||||
$query .= "appid=YahooDemo";
|
||||
$url = PATH.$query;
|
||||
|
||||
|
||||
// Open the Curl session
|
||||
$session = curl_init($url);
|
||||
|
||||
// Don't return HTTP headers. Do return the contents of the call
|
||||
curl_setopt($session, CURLOPT_HEADER, false);
|
||||
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
// Make the call
|
||||
$response = curl_exec($session);
|
||||
|
||||
header("Content-Type: ".$type);
|
||||
echo $response;
|
||||
curl_close($session);
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
/* yadl_spaceid - Skip Stamping */
|
||||
|
||||
// Yahoo! proxy
|
||||
|
||||
// Hard-code hostname and path:
|
||||
define ('PATH', 'http://local.yahooapis.com/LocalSearchService/V2/localSearch');
|
||||
|
||||
$type = "text/xml";
|
||||
|
||||
// Get all query params
|
||||
$query = "?";
|
||||
foreach ($_GET as $key => $value) {
|
||||
if(($key == "output") && ($value == "json")) {
|
||||
$type = "application/json";
|
||||
}
|
||||
$query .= urlencode($key)."=".urlencode($value)."&";
|
||||
}
|
||||
|
||||
foreach ($_POST as $key => $value) {
|
||||
if(($key == "output") && ($value == "json")) {
|
||||
$type = "application/json";
|
||||
}
|
||||
$query .= $key."=".$value."&";
|
||||
}
|
||||
$query .= "appid=YahooDemo";
|
||||
$url = PATH.$query;
|
||||
|
||||
|
||||
// Open the Curl session
|
||||
$session = curl_init($url);
|
||||
|
||||
// Don't return HTTP headers. Do return the contents of the call
|
||||
curl_setopt($session, CURLOPT_HEADER, false);
|
||||
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
// Make the call
|
||||
$response = curl_exec($session);
|
||||
|
||||
header("Content-Type: ".$type);
|
||||
echo $response;
|
||||
curl_close($session);
|
||||
|
||||
?>
|
||||
|
|
|
|||
29
www/extras/yui/examples/datatable/assets/php/yql_proxy.php
Normal file
29
www/extras/yui/examples/datatable/assets/php/yql_proxy.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
/* yadl_spaceid - Skip Stamping */
|
||||
|
||||
// Yahoo! proxy
|
||||
|
||||
// Hard-code hostname and path:
|
||||
define ('PATH', 'http://query.yahooapis.com/v1/public/yql');
|
||||
|
||||
// Get all query params
|
||||
$query = "?format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env&q=";
|
||||
$q = str_replace('"', '"', $_GET['q']);
|
||||
$url = PATH . stripslashes($query) . urlencode(stripslashes(($q)));
|
||||
|
||||
// Open the Curl session
|
||||
$session = curl_init($url);
|
||||
|
||||
// Don't return HTTP headers. Do return the contents of the call
|
||||
curl_setopt($session, CURLOPT_HEADER, false);
|
||||
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
// Make the call
|
||||
$response = curl_exec($session);
|
||||
|
||||
header("Content-Type: application/json");
|
||||
echo $response;
|
||||
curl_close($session);
|
||||
|
||||
?>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Datatable with Autocomplete</title>
|
||||
|
||||
|
|
@ -24,14 +26,14 @@ body {
|
|||
<script type="text/javascript" src="../../build/json/json-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/autocomplete/autocomplete-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
<!--there is no custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Datatable with Autocomplete</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Basic Example</title>
|
||||
|
||||
|
|
@ -20,7 +22,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/dragdrop/dragdrop-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -35,7 +37,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Basic Example</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
538
www/extras/yui/examples/datatable/dt_bhm.html
Normal file
538
www/extras/yui/examples/datatable/dt_bhm.html
Normal file
File diff suppressed because one or more lines are too long
216
www/extras/yui/examples/datatable/dt_bhm_clean.html
Normal file
216
www/extras/yui/examples/datatable/dt_bhm_clean.html
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Integrating Browser History Manager with Server-side Pagination and Sorting</title>
|
||||
|
||||
<style type="text/css">
|
||||
/*margin and padding on body element
|
||||
can introduce errors in determining
|
||||
element position and are not recommended;
|
||||
we turn them off as a foundation for YUI
|
||||
CSS treatments. */
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/paginator/assets/skins/sam/paginator.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/connection/connection-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/json/json-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/history/history-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/paginator/paginator-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
||||
<!--begin custom header content for this example-->
|
||||
<style type="text/css">
|
||||
/* custom styles for this example */
|
||||
#yui-history-iframe {
|
||||
position:absolute;
|
||||
top:0; left:0;
|
||||
width:1px; height:1px; /* avoid scrollbars */
|
||||
visibility:hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--end custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Integrating Browser History Manager with Server-side Pagination and Sorting</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<p>This example combines server-side pagination and sorting with the Browser
|
||||
History Manager for the ability to bookmark states.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
<iframe id="yui-history-iframe" src="assets/html/blank.html"></iframe>
|
||||
<input id="yui-history-field" type="hidden">
|
||||
|
||||
<div id="dt-pag-nav"></div>
|
||||
<div id="bhmintegration"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
// Create the DataSource
|
||||
var myDataSource = new YAHOO.util.DataSource("assets/php/json_proxy.php?");
|
||||
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
|
||||
myDataSource.responseSchema = {
|
||||
resultsList: "records",
|
||||
fields: ["id","name","date","price"],
|
||||
metaFields: {
|
||||
totalRecords: "totalRecords",
|
||||
paginationRecordOffset : "startIndex",
|
||||
paginationRowsPerPage : "pageSize",
|
||||
sortKey: "sort",
|
||||
sortDir: "dir"
|
||||
}
|
||||
};
|
||||
|
||||
// Create the Paginator
|
||||
var myPaginator = new YAHOO.widget.Paginator({
|
||||
containers : ["dt-pag-nav"],
|
||||
template : "{PreviousPageLink} {CurrentPageReport} {NextPageLink} {RowsPerPageDropdown}",
|
||||
pageReportTemplate : "Showing items {startIndex} - {endIndex} of {totalRecords}",
|
||||
rowsPerPageOptions : [10,25,50,100]
|
||||
});
|
||||
|
||||
// Define Columns
|
||||
var myColumnDefs = [
|
||||
{key:"id", label:"ID", sortable:true},
|
||||
{key:"name", label:"Name", sortable:true},
|
||||
{key:"date", label:"Date", sortable:true},
|
||||
{key:"price", label:"Price", sortable:true}
|
||||
];
|
||||
|
||||
// DataTable configurations
|
||||
var myConfig = {
|
||||
paginator : myPaginator,
|
||||
dynamicData : true,
|
||||
initialLoad : false
|
||||
};
|
||||
|
||||
// Instantiate DataTable
|
||||
var myDataTable = new YAHOO.widget.DataTable(
|
||||
"bhmintegration", myColumnDefs, myDataSource, myConfig
|
||||
);
|
||||
|
||||
// Show loading message while page is being rendered
|
||||
myDataTable.showTableMessage(myDataTable.get("MSG_LOADING"), YAHOO.widget.DataTable.CLASS_LOADING);
|
||||
|
||||
// Add the instances to the YAHOO.example namespace for inspection
|
||||
YAHOO.example.BHMIntegration = {
|
||||
myPaginator : myPaginator,
|
||||
myDataSource : myDataSource,
|
||||
myDataTable : myDataTable
|
||||
};
|
||||
|
||||
// Integrate with Browser History Manager
|
||||
var History = YAHOO.util.History;
|
||||
|
||||
// Define a custom function to route sorting through the Browser History Manager
|
||||
var handleSorting = function (oColumn) {
|
||||
// Calculate next sort direction for given Column
|
||||
var sDir = this.getColumnSortDir(oColumn);
|
||||
|
||||
// The next state will reflect the new sort values
|
||||
// while preserving existing pagination rows-per-page
|
||||
// As a best practice, a new sort will reset to page 0
|
||||
var newState = generateRequest(0, oColumn.key, sDir, this.get("paginator").getRowsPerPage());
|
||||
|
||||
// Pass the state along to the Browser History Manager
|
||||
History.navigate("myDataTable", newState);
|
||||
};
|
||||
myDataTable.sortColumn = handleSorting;
|
||||
|
||||
// Define a custom function to route pagination through the Browser History Manager
|
||||
var handlePagination = function(state) {
|
||||
// The next state will reflect the new pagination values
|
||||
// while preserving existing sort values
|
||||
// Note that the sort direction needs to be converted from DataTable format to server value
|
||||
var sortedBy = this.get("sortedBy"),
|
||||
newState = generateRequest(
|
||||
state.recordOffset, sortedBy.key, sortedBy.dir, state.rowsPerPage
|
||||
);
|
||||
|
||||
// Pass the state along to the Browser History Manager
|
||||
History.navigate("myDataTable", newState);
|
||||
};
|
||||
// First we must unhook the built-in mechanism...
|
||||
myPaginator.unsubscribe("changeRequest", myDataTable.onPaginatorChangeRequest);
|
||||
// ...then we hook up our custom function
|
||||
myPaginator.subscribe("changeRequest", handlePagination, myDataTable, true);
|
||||
|
||||
// Update payload data on the fly for tight integration with latest values from server
|
||||
myDataTable.doBeforeLoadData = function(oRequest, oResponse, oPayload) {
|
||||
var meta = oResponse.meta;
|
||||
oPayload.totalRecords = meta.totalRecords || oPayload.totalRecords;
|
||||
oPayload.pagination = {
|
||||
rowsPerPage: meta.paginationRowsPerPage || 10,
|
||||
recordOffset: meta.paginationRecordOffset || 0
|
||||
};
|
||||
oPayload.sortedBy = {
|
||||
key: meta.sortKey || "id",
|
||||
dir: (meta.sortDir) ? "yui-dt-" + meta.sortDir : "yui-dt-asc" // Convert from server value to DataTable format
|
||||
};
|
||||
return true;
|
||||
};
|
||||
|
||||
// Returns a request string for consumption by the DataSource
|
||||
var generateRequest = function(startIndex,sortKey,dir,results) {
|
||||
startIndex = startIndex || 0;
|
||||
sortKey = sortKey || "id";
|
||||
dir = (dir) ? dir.substring(7) : "asc"; // Converts from DataTable format "yui-dt-[dir]" to server value "[dir]"
|
||||
results = results || 10;
|
||||
return "results="+results+"&startIndex="+startIndex+"&sort="+sortKey+"&dir="+dir;
|
||||
};
|
||||
|
||||
// Called by Browser History Manager to trigger a new state
|
||||
var handleHistoryNavigation = function (request) {
|
||||
// Sends a new request to the DataSource
|
||||
myDataSource.sendRequest(request,{
|
||||
success : myDataTable.onDataReturnSetRows,
|
||||
failure : myDataTable.onDataReturnSetRows,
|
||||
scope : myDataTable,
|
||||
argument : {} // Pass in container for population at runtime via doBeforeLoadData
|
||||
});
|
||||
};
|
||||
|
||||
// Calculate the first request
|
||||
var initialRequest = History.getBookmarkedState("myDataTable") || // Passed in via URL
|
||||
generateRequest(); // Get default values
|
||||
|
||||
// Register the module
|
||||
History.register("myDataTable", initialRequest, handleHistoryNavigation);
|
||||
|
||||
// Render the first view
|
||||
History.onReady(function() {
|
||||
// Current state after BHM is initialized is the source of truth for what state to render
|
||||
var currentState = History.getCurrentState("myDataTable");
|
||||
handleHistoryNavigation(currentState);
|
||||
});
|
||||
|
||||
// Initialize the Browser History Manager.
|
||||
YAHOO.util.History.initialize("yui-history-field", "yui-history-iframe");
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
542
www/extras/yui/examples/datatable/dt_bhm_log.html
Normal file
542
www/extras/yui/examples/datatable/dt_bhm_log.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Inline Cell Editing</title>
|
||||
|
||||
|
|
@ -21,7 +23,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/calendar/calendar-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -36,7 +38,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Inline Cell Editing</h1>
|
||||
|
|
@ -68,13 +70,14 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
{key:"amount", editor: new YAHOO.widget.TextboxCellEditor({validator:YAHOO.widget.DataTable.validateNumber})},
|
||||
{key:"active", editor: new YAHOO.widget.RadioCellEditor({radioOptions:["yes","no","maybe"],disableBtns:true})},
|
||||
{key:"colors", editor: new YAHOO.widget.CheckboxCellEditor({checkboxOptions:["red","yellow","blue"]})},
|
||||
{key:"fruit", editor: new YAHOO.widget.DropdownCellEditor({multiple:true,dropdownOptions:["apple","banana","cherry"]})},
|
||||
{key:"last_login", formatter:YAHOO.widget.DataTable.formatDate, editor: new YAHOO.widget.DateCellEditor()}
|
||||
];
|
||||
|
||||
var myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.addresses);
|
||||
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
||||
myDataSource.responseSchema = {
|
||||
fields: ["address","city","state","amount","active","colors",{key:"last_login",parser:"date"}]
|
||||
fields: ["address","city","state","amount","active","colors","fruit",{key:"last_login",parser:"date"}]
|
||||
};
|
||||
|
||||
var myDataTable = new YAHOO.widget.DataTable("cellediting", myColumnDefs, myDataSource, {});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Cell Selection</title>
|
||||
|
||||
|
|
@ -19,7 +21,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -35,7 +37,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Cell Selection</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Client-side Pagination</title>
|
||||
|
||||
|
|
@ -22,7 +24,7 @@ body {
|
|||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/connection/connection-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/json/json-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/paginator/paginator-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
|
@ -45,7 +47,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Client-side Pagination</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Client-side Sorting</title>
|
||||
|
||||
|
|
@ -19,7 +21,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -27,7 +29,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Client-side Sorting</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Complex Example of Multiple Features</title>
|
||||
|
||||
|
|
@ -19,7 +21,10 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/paginator/assets/skins/sam/paginator.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/utilities/utilities.js"></script>
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/dragdrop/dragdrop-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/animation/animation-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/paginator/paginator-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
|
@ -31,7 +36,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Complex Example of Multiple Features</h1>
|
||||
|
|
@ -90,7 +95,8 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
template: YAHOO.widget.Paginator.TEMPLATE_ROWS_PER_PAGE,
|
||||
rowsPerPageOptions: [10,25,50,100],
|
||||
pageLinks: 5
|
||||
})
|
||||
}),
|
||||
draggableColumns:true
|
||||
}
|
||||
|
||||
var myDataTable = new YAHOO.widget.DataTable("complex", myColumnDefs, myDataSource, myConfigs);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Context Menu Integration</title>
|
||||
|
||||
|
|
@ -22,7 +24,7 @@ body {
|
|||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/container/container_core-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/menu/menu-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -38,7 +40,7 @@ div.yuimenu .bd {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Context Menu Integration</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
523
www/extras/yui/examples/datatable/dt_ddrows.html
Normal file
523
www/extras/yui/examples/datatable/dt_ddrows.html
Normal file
File diff suppressed because one or more lines are too long
192
www/extras/yui/examples/datatable/dt_ddrows_clean.html
Normal file
192
www/extras/yui/examples/datatable/dt_ddrows_clean.html
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Reorder Rows with Drag and Drop</title>
|
||||
|
||||
<style type="text/css">
|
||||
/*margin and padding on body element
|
||||
can introduce errors in determining
|
||||
element position and are not recommended;
|
||||
we turn them off as a foundation for YUI
|
||||
CSS treatments. */
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/dragdrop/dragdrop-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
||||
<!--begin custom header content for this example-->
|
||||
<style type="text/css">
|
||||
/* custom styles for this example */
|
||||
.custom-class {
|
||||
opacity: 0.6;filter:alpha(opacity=60);
|
||||
color:blue;
|
||||
border: 2px solid gray;
|
||||
}
|
||||
|
||||
#datatable tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--end custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
<cite class="byline">The code for the <code>DDRows</code> class and this example has been contributed to YUI by Gonzalo Cordero, <a target="_blank" href="http://yuiblog.com/blog/2007/12/06/juku/">Juku</a> graduate and Front-End Engineer on the Yahoo! Flex Force team who is currently working on the next generation of Yahoo! homepage.</cite>
|
||||
|
||||
<h1>Reorder Rows with Drag and Drop</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<p>Reorder rows of a DataTable with Drag and Drop.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
<div id="datatable"></div>
|
||||
|
||||
<script type="text/javascript" src="assets/js/data.js"></script>
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.addListener(window, "load", function() {
|
||||
YAHOO.example.ReorderRows = function() {
|
||||
var Dom = YAHOO.util.Dom,
|
||||
Event = YAHOO.util.Event,
|
||||
DDM = YAHOO.util.DragDropMgr,
|
||||
myColumnDefs = [
|
||||
{key:"id"},
|
||||
{key:"date", formatter:"date"},
|
||||
{key:"quantity", formatter:"number"},
|
||||
{key:"amount", formatter:"currency"},
|
||||
{key:"title"}
|
||||
],
|
||||
myDataSource = new YAHOO.util.LocalDataSource(
|
||||
YAHOO.example.Data.bookorders,
|
||||
{responseSchema: {fields: ["id","date","quantity","amount","title"]}}
|
||||
),
|
||||
myDataTable = new YAHOO.widget.DataTable("datatable", myColumnDefs, myDataSource, {caption:"YUI Datatable/DragDrop"}),
|
||||
myDTDrags = {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Custom drag and drop class
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
YAHOO.example.DDRows = function(id, sGroup, config) {
|
||||
YAHOO.example.DDRows.superclass.constructor.call(this, id, sGroup, config);
|
||||
Dom.addClass(this.getDragEl(),"custom-class");
|
||||
this.goingUp = false;
|
||||
this.lastY = 0;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// DDRows extends DDProxy
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
YAHOO.extend(YAHOO.example.DDRows, YAHOO.util.DDProxy, {
|
||||
proxyEl: null,
|
||||
srcEl:null,
|
||||
srcData:null,
|
||||
srcIndex: null,
|
||||
tmpIndex:null,
|
||||
|
||||
startDrag: function(x, y) {
|
||||
var proxyEl = this.proxyEl = this.getDragEl(),
|
||||
srcEl = this.srcEl = this.getEl();
|
||||
|
||||
this.srcData = myDataTable.getRecord(this.srcEl).getData();
|
||||
this.srcIndex = srcEl.sectionRowIndex;
|
||||
// Make the proxy look like the source element
|
||||
Dom.setStyle(srcEl, "visibility", "hidden");
|
||||
proxyEl.innerHTML = "<table><tbody>"+srcEl.innerHTML+"</tbody></table>";
|
||||
},
|
||||
|
||||
endDrag: function(x,y) {
|
||||
var position,
|
||||
srcEl = this.srcEl;
|
||||
|
||||
Dom.setStyle(this.proxyEl, "visibility", "hidden");
|
||||
Dom.setStyle(srcEl, "visibility", "");
|
||||
},
|
||||
|
||||
onDrag: function(e) {
|
||||
// Keep track of the direction of the drag for use during onDragOver
|
||||
var y = Event.getPageY(e);
|
||||
|
||||
if (y < this.lastY) {
|
||||
this.goingUp = true;
|
||||
} else if (y > this.lastY) {
|
||||
this.goingUp = false;
|
||||
}
|
||||
|
||||
this.lastY = y;
|
||||
},
|
||||
|
||||
onDragOver: function(e, id) {
|
||||
// Reorder rows as user drags
|
||||
var srcIndex = this.srcIndex,
|
||||
destEl = Dom.get(id),
|
||||
destIndex = destEl.sectionRowIndex,
|
||||
tmpIndex = this.tmpIndex;
|
||||
|
||||
if (destEl.nodeName.toLowerCase() === "tr") {
|
||||
if(tmpIndex !== null) {
|
||||
myDataTable.deleteRow(tmpIndex);
|
||||
}
|
||||
else {
|
||||
myDataTable.deleteRow(this.srcIndex);
|
||||
}
|
||||
|
||||
myDataTable.addRow(this.srcData, destIndex);
|
||||
this.tmpIndex = destIndex;
|
||||
|
||||
DDM.refreshCache();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Create DDRows instances when DataTable is initialized
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
myDataTable.subscribe("initEvent", function() {
|
||||
var i, id,
|
||||
allRows = this.getTbodyEl().rows;
|
||||
|
||||
for(i=0; i<allRows.length; i++) {
|
||||
id = allRows[i].id;
|
||||
// Clean up any existing Drag instances
|
||||
if (myDTDrags[id]) {
|
||||
myDTDrags[id].unreg();
|
||||
delete myDTDrags[id];
|
||||
}
|
||||
// Create a Drag instance for each row
|
||||
myDTDrags[id] = new YAHOO.example.DDRows(id);
|
||||
}
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Create DDRows instances when new row is added
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
myDataTable.subscribe("rowAddEvent",function(e){
|
||||
var id = e.record.getId();
|
||||
myDTDrags[id] = new YAHOO.example.DDRows(id);
|
||||
})
|
||||
}();
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
527
www/extras/yui/examples/datatable/dt_ddrows_log.html
Normal file
527
www/extras/yui/examples/datatable/dt_ddrows_log.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Server-side Pagination and Sorting for Dynamic Data</title>
|
||||
|
||||
|
|
@ -22,7 +24,7 @@ body {
|
|||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/connection/connection-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/json/json-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/paginator/paginator-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
|
@ -31,7 +33,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Server-side Pagination and Sorting for Dynamic Data</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
356
www/extras/yui/examples/datatable/dt_dynamicfilter.html
Normal file
356
www/extras/yui/examples/datatable/dt_dynamicfilter.html
Normal file
File diff suppressed because one or more lines are too long
358
www/extras/yui/examples/datatable/dt_dynamicfilter_log.html
Normal file
358
www/extras/yui/examples/datatable/dt_dynamicfilter_log.html
Normal file
File diff suppressed because one or more lines are too long
498
www/extras/yui/examples/datatable/dt_dynamicfilter_source.html
Normal file
498
www/extras/yui/examples/datatable/dt_dynamicfilter_source.html
Normal file
|
|
@ -0,0 +1,498 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<!-- Combo-handled YUIS files:-->
|
||||
<link rel="stylesheet" type="text/css" href="../../build/reset/reset.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../build/base/base.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts.css">
|
||||
|
||||
<style type="text/css">
|
||||
#doc {
|
||||
width: 700px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#hd {
|
||||
text-align: center;
|
||||
}
|
||||
.yui-skin-sam .yui-dt table {
|
||||
width: 100%;
|
||||
}
|
||||
.yui-skin-sam .yui-dt th.yui-dt-col-name {
|
||||
width: 301px;
|
||||
}
|
||||
.yui-skin-sam .yui-dt .yui-dt-col-state1,
|
||||
.yui-skin-sam .yui-dt .yui-dt-col-state2,
|
||||
.yui-skin-sam .yui-dt .yui-dt-col-state3 {
|
||||
width: 133px;
|
||||
text-align: right;
|
||||
}
|
||||
#containerContainer {
|
||||
width: 100%;
|
||||
height: 64px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
#genderRadioContainer {
|
||||
float: left;
|
||||
width: 301px;
|
||||
}
|
||||
#stateSelectContainer {
|
||||
float: left;
|
||||
width: 399px;
|
||||
}
|
||||
#stateSelectContainer .yui-button button{
|
||||
width: 123px;
|
||||
*width: 121px;
|
||||
_width: 118px;
|
||||
font-size: 85%;
|
||||
line-height: 1.5;
|
||||
}
|
||||
#statePaginator {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<body class="yui-skin-sam">
|
||||
<div id="doc" class="yui-skin-sam">
|
||||
<div id="hd">
|
||||
<h1>State Population Comparison Table</h1>
|
||||
</div>
|
||||
<div id="bd">
|
||||
<div id="containerContainer">
|
||||
<div id="genderRadioContainer">
|
||||
<p>Select a gender filter.</p>
|
||||
<input type="radio" name="gender" value="Both" checked>
|
||||
<input type="radio" name="gender" value="Female">
|
||||
<input type="radio" name="gender" value="Male">
|
||||
</div>
|
||||
<div id="stateSelectContainer">
|
||||
<p>Select states to compare.</p>
|
||||
<input type="button" class="menuButton" id="state1" value="<em>Alabama</em>">
|
||||
<select id="state1Select">
|
||||
<option value="04000US01">Alabama</option>
|
||||
<option value="04000US02">Alaska</option>
|
||||
<option value="04000US04">Arizona</option>
|
||||
<option value="04000US05">Arkansas</option>
|
||||
<option value="04000US06">California</option>
|
||||
<option value="04000US08">Colorado</option>
|
||||
<option value="04000US09">Connecticut</option>
|
||||
<option value="04000US10">Delaware</option>
|
||||
<option value="04000US11">DC</option>
|
||||
<option value="04000US12">Florida</option>
|
||||
<option value="04000US13">Georgia</option>
|
||||
<option value="04000US15">Hawaii</option>
|
||||
<option value="04000US16">Idaho</option>
|
||||
<option value="04000US17">Illinois</option>
|
||||
<option value="04000US18">Indiana</option>
|
||||
<option value="04000US19">Iowa</option>
|
||||
<option value="04000US20">Kansas</option>
|
||||
<option value="04000US21">Kentucky</option>
|
||||
<option value="04000US22">Louisiana</option>
|
||||
<option value="04000US23">Maine</option>
|
||||
<option value="04000US24">Maryland</option>
|
||||
<option value="04000US25">Massachusetts</option>
|
||||
<option value="04000US26">Michigan</option>
|
||||
<option value="04000US27">Minnesota</option>
|
||||
<option value="04000US28">Mississippi</option>
|
||||
<option value="04000US29">Missouri</option>
|
||||
<option value="04000US30">Montana</option>
|
||||
<option value="04000US31">Nebraska</option>
|
||||
<option value="04000US32">Nevada</option>
|
||||
<option value="04000US33">New Hampshire</option>
|
||||
<option value="04000US34">New Jersey</option>
|
||||
<option value="04000US35">New Mexico</option>
|
||||
<option value="04000US36">New York</option>
|
||||
<option value="04000US37">North Carolina</option>
|
||||
<option value="04000US38">North Dakota</option>
|
||||
<option value="04000US39">Ohio</option>
|
||||
<option value="04000US40">Oklahoma</option>
|
||||
<option value="04000US41">Oregon</option>
|
||||
<option value="04000US42">Pennsylvania</option>
|
||||
<option value="04000US72">Puerto Rico</option>
|
||||
<option value="04000US44">Rhode Island</option>
|
||||
<option value="04000US45">South Carolina</option>
|
||||
<option value="04000US46">South Dakota</option>
|
||||
<option value="04000US47">Tennessee</option>
|
||||
<option value="04000US48">Texas</option>
|
||||
<option value="04000US49">Utah</option>
|
||||
<option value="04000US50">Vermont</option>
|
||||
<option value="04000US51">Virginia</option>
|
||||
<option value="04000US53">Washington</option>
|
||||
<option value="04000US54">West Virginia</option>
|
||||
<option value="04000US55">Wisconsin</option>
|
||||
<option value="04000US56">Wyoming</option>
|
||||
</select>
|
||||
|
||||
<input type="button" class="menuButton" id="state2" value="State 2">
|
||||
<select id="state2Select">
|
||||
<option value="04000US01">Alabama</option>
|
||||
<option value="04000US02">Alaska</option>
|
||||
<option value="04000US04">Arizona</option>
|
||||
<option value="04000US05">Arkansas</option>
|
||||
<option value="04000US06">California</option>
|
||||
<option value="04000US08">Colorado</option>
|
||||
<option value="04000US09">Connecticut</option>
|
||||
<option value="04000US10">Delaware</option>
|
||||
<option value="04000US11">DC</option>
|
||||
<option value="04000US12">Florida</option>
|
||||
<option value="04000US13">Georgia</option>
|
||||
<option value="04000US15">Hawaii</option>
|
||||
<option value="04000US16">Idaho</option>
|
||||
<option value="04000US17">Illinois</option>
|
||||
<option value="04000US18">Indiana</option>
|
||||
<option value="04000US19">Iowa</option>
|
||||
<option value="04000US20">Kansas</option>
|
||||
<option value="04000US21">Kentucky</option>
|
||||
<option value="04000US22">Louisiana</option>
|
||||
<option value="04000US23">Maine</option>
|
||||
<option value="04000US24">Maryland</option>
|
||||
<option value="04000US25">Massachusetts</option>
|
||||
<option value="04000US26">Michigan</option>
|
||||
<option value="04000US27">Minnesota</option>
|
||||
<option value="04000US28">Mississippi</option>
|
||||
<option value="04000US29">Missouri</option>
|
||||
<option value="04000US30">Montana</option>
|
||||
<option value="04000US31">Nebraska</option>
|
||||
<option value="04000US32">Nevada</option>
|
||||
<option value="04000US33">New Hampshire</option>
|
||||
<option value="04000US34">New Jersey</option>
|
||||
<option value="04000US35">New Mexico</option>
|
||||
<option value="04000US36">New York</option>
|
||||
<option value="04000US37">North Carolina</option>
|
||||
<option value="04000US38">North Dakota</option>
|
||||
<option value="04000US39">Ohio</option>
|
||||
<option value="04000US40">Oklahoma</option>
|
||||
<option value="04000US41">Oregon</option>
|
||||
<option value="04000US42">Pennsylvania</option>
|
||||
<option value="04000US72">Puerto Rico</option>
|
||||
<option value="04000US44">Rhode Island</option>
|
||||
<option value="04000US45">South Carolina</option>
|
||||
<option value="04000US46">South Dakota</option>
|
||||
<option value="04000US47">Tennessee</option>
|
||||
<option value="04000US48">Texas</option>
|
||||
<option value="04000US49">Utah</option>
|
||||
<option value="04000US50">Vermont</option>
|
||||
<option value="04000US51">Virginia</option>
|
||||
<option value="04000US53">Washington</option>
|
||||
<option value="04000US54">West Virginia</option>
|
||||
<option value="04000US55">Wisconsin</option>
|
||||
<option value="04000US56">Wyoming</option>
|
||||
</select>
|
||||
|
||||
<input type="button" class="menuButton" id="state3" value="State 3">
|
||||
<select id="state3Select">
|
||||
<option value="04000US01">Alabama</option>
|
||||
<option value="04000US02">Alaska</option>
|
||||
<option value="04000US04">Arizona</option>
|
||||
<option value="04000US05">Arkansas</option>
|
||||
<option value="04000US06">California</option>
|
||||
<option value="04000US08">Colorado</option>
|
||||
<option value="04000US09">Connecticut</option>
|
||||
<option value="04000US10">Delaware</option>
|
||||
<option value="04000US11">DC</option>
|
||||
<option value="04000US12">Florida</option>
|
||||
<option value="04000US13">Georgia</option>
|
||||
<option value="04000US15">Hawaii</option>
|
||||
<option value="04000US16">Idaho</option>
|
||||
<option value="04000US17">Illinois</option>
|
||||
<option value="04000US18">Indiana</option>
|
||||
<option value="04000US19">Iowa</option>
|
||||
<option value="04000US20">Kansas</option>
|
||||
<option value="04000US21">Kentucky</option>
|
||||
<option value="04000US22">Louisiana</option>
|
||||
<option value="04000US23">Maine</option>
|
||||
<option value="04000US24">Maryland</option>
|
||||
<option value="04000US25">Massachusetts</option>
|
||||
<option value="04000US26">Michigan</option>
|
||||
<option value="04000US27">Minnesota</option>
|
||||
<option value="04000US28">Mississippi</option>
|
||||
<option value="04000US29">Missouri</option>
|
||||
<option value="04000US30">Montana</option>
|
||||
<option value="04000US31">Nebraska</option>
|
||||
<option value="04000US32">Nevada</option>
|
||||
<option value="04000US33">New Hampshire</option>
|
||||
<option value="04000US34">New Jersey</option>
|
||||
<option value="04000US35">New Mexico</option>
|
||||
<option value="04000US36">New York</option>
|
||||
<option value="04000US37">North Carolina</option>
|
||||
<option value="04000US38">North Dakota</option>
|
||||
<option value="04000US39">Ohio</option>
|
||||
<option value="04000US40">Oklahoma</option>
|
||||
<option value="04000US41">Oregon</option>
|
||||
<option value="04000US42">Pennsylvania</option>
|
||||
<option value="04000US72">Puerto Rico</option>
|
||||
<option value="04000US44">Rhode Island</option>
|
||||
<option value="04000US45">South Carolina</option>
|
||||
<option value="04000US46">South Dakota</option>
|
||||
<option value="04000US47">Tennessee</option>
|
||||
<option value="04000US48">Texas</option>
|
||||
<option value="04000US49">Utah</option>
|
||||
<option value="04000US50">Vermont</option>
|
||||
<option value="04000US51">Virginia</option>
|
||||
<option value="04000US53">Washington</option>
|
||||
<option value="04000US54">West Virginia</option>
|
||||
<option value="04000US55">Wisconsin</option>
|
||||
<option value="04000US56">Wyoming</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="statePaginator"><!-- The Paginator widget is rendered here --></div>
|
||||
|
||||
<div id="stateTable"><!-- The DataTable widget is rendered here --></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Combo-handled YUI JS files: -->
|
||||
<script type="text/javascript" src="../../build/yuiloader/yuiloader.js"></script>
|
||||
<script type="text/javascript">
|
||||
var loader = new YAHOO.util.YUILoader();
|
||||
loader.insert({
|
||||
require: ["reset", "fonts", "menu", "button", "connection", "paginator", "datatable"],
|
||||
base: '../../build/',
|
||||
//filter: 'debug',
|
||||
allowRollup: false,
|
||||
onSuccess: function() {
|
||||
var Dom = YAHOO.util.Dom,
|
||||
Event = YAHOO.util.Event,
|
||||
XHRDataSource = YAHOO.util.XHRDataSource,
|
||||
Button = YAHOO.widget.Button,
|
||||
ButtonGroup = YAHOO.widget.ButtonGroup,
|
||||
DataTable = YAHOO.widget.DataTable,
|
||||
Paginator = YAHOO.widget.Paginator,
|
||||
CF; // CustomFilter
|
||||
|
||||
/**
|
||||
* CF creates a paginated DataTable of United States population data
|
||||
* which can be filtered by state and/or by gender.
|
||||
*/
|
||||
CF = {
|
||||
/**
|
||||
* The three state Menu Buttons are stored in this array.
|
||||
*/
|
||||
menuButtons: [],
|
||||
|
||||
/**
|
||||
* Filter settings (gender/states) are stored here. These
|
||||
* settings are then used to create the query string.
|
||||
*/
|
||||
settings: {
|
||||
gender: 'Both',
|
||||
state1: '',
|
||||
state2: '',
|
||||
state3: ''
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize all the Buttons/Menu Buttons and the DataTable.
|
||||
*/
|
||||
init: function () {
|
||||
var myColumnDefs,
|
||||
myDataSource,
|
||||
myConfigs,
|
||||
genderButtons,
|
||||
// Get the three United States select menu elements (of course these start out as Input Elements)
|
||||
menuEls = Dom.getElementsByClassName('menuButton', 'input', 'stateSelectContainer');
|
||||
|
||||
// Create the three Menu Buttons for the United States select menus.
|
||||
Dom.batch(menuEls, this.createMenuButton);
|
||||
|
||||
// Create the Radio Buttons for selecting a gender filter.
|
||||
genderButtons = new ButtonGroup('genderRadioContainer');
|
||||
|
||||
// Subscribe to the checked change event which enables us
|
||||
// to save the new setting and request new data for the DataTable.
|
||||
genderButtons.subscribe('checkedButtonChange', CF.genderButtonsCheckedChange);
|
||||
|
||||
// Define the DataTable's columns
|
||||
myColumnDefs = [
|
||||
{key: "name", label: "Statistic Name"},
|
||||
{key: "state1", label: "State 1", formatter: 'number'},
|
||||
{key: "state2", label: "State 2", formatter: 'number'},
|
||||
{key: "state3", label: "State 3", formatter: 'number'}
|
||||
];
|
||||
|
||||
// Create a new DataSource
|
||||
myDataSource = new XHRDataSource("assets/php/dynamicfilter/data.php?");
|
||||
|
||||
// data.php just happens to use JSON. Let the DataSource
|
||||
// know to expect JSON data.
|
||||
myDataSource.responseType = XHRDataSource.TYPE_JSON;
|
||||
|
||||
// Define the structure of the DataSource data.
|
||||
myDataSource.responseSchema = {
|
||||
resultsList: "records",
|
||||
fields: [
|
||||
{key: "name"},
|
||||
{key: "state1"},
|
||||
{key: "state2"},
|
||||
{key: "state3"}
|
||||
],
|
||||
metaFields: {
|
||||
totalRecords: "totalRecords"
|
||||
}
|
||||
};
|
||||
|
||||
// Set the DataTable configuration
|
||||
myConfigs = {
|
||||
initialLoad: false,
|
||||
dynamicData: true,
|
||||
paginator: new Paginator({
|
||||
rowsPerPage: 25,
|
||||
containers: 'statePaginator'
|
||||
}),
|
||||
|
||||
// This configuration item is what builds the query string
|
||||
// passed to the DataSource.
|
||||
generateRequest: this.requestBuilder
|
||||
};
|
||||
|
||||
// Create the DataTable.
|
||||
myDataTable = new DataTable("stateTable", myColumnDefs, myDataSource, myConfigs);
|
||||
|
||||
// Define an event handler that scoops up the totalRecords which we sent as
|
||||
// part of the JSON data. This is then used to tell the paginator the total records.
|
||||
// This happens after each time the DataTable is updated with new data.
|
||||
myDataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
|
||||
oPayload.totalRecords = oResponse.meta.totalRecords;
|
||||
return oPayload;
|
||||
}
|
||||
|
||||
// Store the DataTable and DataSource for use elsewhere in this script.
|
||||
CF.myDataSource = myDataSource;
|
||||
CF.myDataTable = myDataTable;
|
||||
|
||||
// Initial load
|
||||
CF.settings.state1 = "04000US01";
|
||||
CF.fireDT(false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a Menu Button. Once the Menu Button is created, attached a
|
||||
* selectedMenuItemChange event listener.
|
||||
* @param {Object} el
|
||||
* An HTML Input Element used in creating a Menu Button from markup.
|
||||
*/
|
||||
createMenuButton: function (el) {
|
||||
var buttonKey = CF.menuButtons.length;
|
||||
CF.menuButtons[buttonKey] = new Button(el, {
|
||||
type: 'menu',
|
||||
menu: Dom.getNextSibling(el)
|
||||
});
|
||||
CF.menuButtons[buttonKey].on("selectedMenuItemChange", CF.menuButtonMenuItemChange);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handler for the selectedMenuItemChange event for the Menu Buttons.
|
||||
* This changes the label on the Menu buttons. Then, stores the value
|
||||
* of the new selected Menu Item in the CF.settings object. Each of the
|
||||
* Menu Buttons has an id that corresponds to one of the three United States
|
||||
* columns in the DataTable. This id is used as the key for the CF.settings.[STATE]
|
||||
* object. Lastly, fire a request for new data for the DataTable. Pass in a boolean
|
||||
* false so that the pagination settings are retained.
|
||||
* @param {Object} e
|
||||
*/
|
||||
menuButtonMenuItemChange: function (e) {
|
||||
var oMenuItem = e.newValue;
|
||||
this.set("label", ("<em class=\"yui-button-label\">" +
|
||||
oMenuItem.cfg.getProperty("text") + "<\/em>"));
|
||||
CF.settings[this.get('id')] = oMenuItem.value;
|
||||
CF.fireDT(false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handler for the checkedButtonChange event for the Gender Radio Buttons.
|
||||
* This stores the new value in the CF.settings.gender variable. Then
|
||||
* it fires a request for new DataTable data passing in a boolean true
|
||||
* so that the pagination is reset to the first recordOffset (which is 0).
|
||||
* @param {Object} e
|
||||
*/
|
||||
genderButtonsCheckedChange: function(e) {
|
||||
CF.settings.gender = e.newValue.get('label');
|
||||
CF.fireDT(true);
|
||||
},
|
||||
|
||||
/**
|
||||
* This method is passed into the DataTable's "generateRequest" configuration
|
||||
* setting overriding the default generateRequest function. This function puts
|
||||
* together a query string which is passed to the DataSource each time a new
|
||||
* set of data is requested. All of the custom sorting and filtering options
|
||||
* added in by this script are gathered up here and inserted into the
|
||||
* query string.
|
||||
* @param {Object} oState
|
||||
* @param {Object} oSelf
|
||||
* These parameters are explained in detail in DataTable's API
|
||||
* documentation. It's important to note that oState contains
|
||||
* a reference to the paginator and the pagination state and
|
||||
* the column sorting state as well.
|
||||
*/
|
||||
requestBuilder: function (oState, oSelf) {
|
||||
/* We aren't initializing sort and dir variables. If you are
|
||||
using column sorting built into the DataTable, use this
|
||||
set of variable initializers.
|
||||
var sort, dir, startIndex, results; */
|
||||
var startIndex, results;
|
||||
|
||||
oState = oState || {pagination: null, sortedBy: null};
|
||||
|
||||
/* If using column sorting built into DataTable, these next two lines
|
||||
will properly set the current _sortedBy_ column and the _sortDirection_
|
||||
sort = (oState.sortedBy) ? oState.sortedBy.key : oSelf.getColumnSet().keys[0].getKey();
|
||||
dir = (oState.sortedBy && oState.sortedBy.dir === DataTable.CLASS_DESC) ? "desc" : "asc"; */
|
||||
startIndex = (oState.pagination) ? oState.pagination.recordOffset : 0;
|
||||
results = (oState.pagination) ? oState.pagination.rowsPerPage : null;
|
||||
|
||||
return "&results=" + results +
|
||||
"&startIndex=" + startIndex +
|
||||
"&state[1]=" + CF.settings.state1 +
|
||||
"&state[2]=" + CF.settings.state2 +
|
||||
"&state[3]=" + CF.settings.state3 +
|
||||
"&gender=" + CF.settings.gender;
|
||||
},
|
||||
|
||||
/**
|
||||
* This method is used to fire off a request for new data for the
|
||||
* DataTable from the DataSource. The new state of the DataTable,
|
||||
* after the request for new data, will be determined here.
|
||||
* @param {Boolean} resetRecordOffset
|
||||
*/
|
||||
fireDT: function (resetRecordOffset) {
|
||||
var oState = CF.myDataTable.getState(),
|
||||
request,
|
||||
oCallback;
|
||||
|
||||
/* We don't always want to reset the recordOffset.
|
||||
If we want the Paginator to be set to the first page,
|
||||
pass in a value of true to this method. Otherwise, pass in
|
||||
false or anything falsy and the paginator will remain at the
|
||||
page it was set at before.*/
|
||||
if (resetRecordOffset) {
|
||||
oState.pagination.recordOffset = 0;
|
||||
}
|
||||
|
||||
/* If the column sort direction needs to be updated, that may be done here.
|
||||
It is beyond the scope of this example, but the DataTable::sortColumn() method
|
||||
has code that can be used with some modification. */
|
||||
|
||||
/*
|
||||
This example uses onDataReturnSetRows because that method
|
||||
will clear out the old data in the DataTable, making way for
|
||||
the new data.*/
|
||||
oCallback = {
|
||||
success : CF.myDataTable.onDataReturnSetRows,
|
||||
failure : CF.myDataTable.onDataReturnSetRows,
|
||||
argument : oState,
|
||||
scope : CF.myDataTable
|
||||
};
|
||||
|
||||
// Generate a query string
|
||||
request = CF.myDataTable.get("generateRequest")(oState, CF.myDataTable);
|
||||
|
||||
// Fire off a request for new data.
|
||||
CF.myDataSource.sendRequest(request, oCallback);
|
||||
}
|
||||
};
|
||||
|
||||
CF.init();
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Progressive Enhancement</title>
|
||||
|
||||
|
|
@ -19,7 +21,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -27,7 +29,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Progressive Enhancement</h1>
|
||||
|
|
@ -131,7 +133,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
|
||||
var myDataTable = new YAHOO.widget.DataTable("markup", myColumnDefs, myDataSource,
|
||||
{caption:"Example: Progressively Enhanced Table from Markup",
|
||||
sortedBy:{key:"due",dir:"desc"}}
|
||||
sortedBy:{key:"due",dir:"asc"}}
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>XY-scrolling, Y-scrolling, and X-scrolling</title>
|
||||
|
||||
|
|
@ -20,7 +22,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/button/assets/skins/sam/button.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/button/button-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
|
@ -29,15 +31,17 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>XY-scrolling, Y-scrolling, and X-scrolling</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<p>Scrolling can be enabled on a DataTable along the x, y, or xy-axes. Set the
|
||||
DataTable's "scrollable" value to "true", and set a width and/and or height string
|
||||
values.</p>
|
||||
<p>Scrolling can be enabled along the x, y, or xy-axes. Call the
|
||||
YAHOO.widget.ScrollingDataTable constructor and pass in width and/and or height
|
||||
string values as configurations. Since scrolling functionality has been moved to
|
||||
the ScrollingDataTable subclass, please note that you cannot start with a
|
||||
YAHOO.widget.DataTable instance and add scrolling to it dynamically at runtime.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -97,17 +101,17 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
]
|
||||
};
|
||||
|
||||
// Set "scrollable:true" and set width and height string values
|
||||
var myDataTableXY = new YAHOO.widget.DataTable("xyscrolling", myColumnDefs,
|
||||
myDataSource, {scrollable:true, width:"30em", height:"10em"});
|
||||
// Set width and height as string values
|
||||
var myDataTableXY = new YAHOO.widget.ScrollingDataTable("xyscrolling", myColumnDefs,
|
||||
myDataSource, {width:"30em", height:"10em"});
|
||||
|
||||
// Set "scrollable:true" and set only height string value
|
||||
var myDataTableY = new YAHOO.widget.DataTable("yscrolling", myColumnDefsY,
|
||||
myDataSource, {scrollable:true, height:"10em"});
|
||||
// Set height as a string value
|
||||
var myDataTableY = new YAHOO.widget.ScrollingDataTable("yscrolling", myColumnDefsY,
|
||||
myDataSource, {height:"10em"});
|
||||
|
||||
// Set "scrollable:true" and set only width string value
|
||||
var myDataTableX = new YAHOO.widget.DataTable("xscrolling", myColumnDefsX,
|
||||
myDataSource, {scrollable:true, width:"30em"});
|
||||
// Set width as a string value
|
||||
var myDataTableX = new YAHOO.widget.ScrollingDataTable("xscrolling", myColumnDefsX,
|
||||
myDataSource, {width:"30em"});
|
||||
|
||||
return {
|
||||
oDS: myDataSource,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -30,14 +30,14 @@ loader.insert({
|
|||
// a green background color if value of field3 is greater than 100.
|
||||
// Otherwise renders a down icon and assigns class "down", setting
|
||||
// the background color to red.
|
||||
var myCustomFormatter = function(elCell, oRecord, oColumn, oData) {
|
||||
var myCustomFormatter = function(elLiner, oRecord, oColumn, oData) {
|
||||
if(oRecord.getData("field3") > 100) {
|
||||
YAHOO.util.Dom.replaceClass(elCell.parentNode, "down", "up");
|
||||
elCell.innerHTML = ' <img src="../../build/datatable/assets/skins/sam/dt-arrow-up.png">';
|
||||
YAHOO.util.Dom.replaceClass(elLiner.parentNode, "down", "up");
|
||||
elLiner.innerHTML = ' <img src="../../build/datatable/assets/skins/sam/dt-arrow-up.png">';
|
||||
}
|
||||
else {
|
||||
YAHOO.util.Dom.replaceClass(elCell.parentNode, "up","down");
|
||||
elCell.innerHTML = ' <img src="../../build/datatable/assets/skins/sam/dt-arrow-dn.png">';
|
||||
YAHOO.util.Dom.replaceClass(elLiner.parentNode, "up","down");
|
||||
elLiner.innerHTML = ' <img src="../../build/datatable/assets/skins/sam/dt-arrow-dn.png">';
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -45,9 +45,9 @@ loader.insert({
|
|||
YAHOO.widget.DataTable.Formatter.myCustom = myCustomFormatter;
|
||||
|
||||
// Override the built-in formatter
|
||||
YAHOO.widget.DataTable.formatEmail = function(elCell, oRecord, oColumn, oData) {
|
||||
YAHOO.widget.DataTable.formatEmail = function(elLiner, oRecord, oColumn, oData) {
|
||||
var user = oData;
|
||||
elCell.innerHTML = "<a href=\"mailto:" + user + "@mycompany.com\">" + user + "</a>";
|
||||
elLiner.innerHTML = "<a href=\"mailto:" + user + "@mycompany.com\">" + user + "</a>";
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Highlighting Cells, Rows, or Columns</title>
|
||||
|
||||
|
|
@ -17,13 +19,9 @@ body {
|
|||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/button/assets/skins/sam/button.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/container/assets/skins/sam/container.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/button/button-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/container/container-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -31,7 +29,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Highlighting Cells, Rows, or Columns</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
341
www/extras/yui/examples/datatable/dt_localfilter.html
Normal file
341
www/extras/yui/examples/datatable/dt_localfilter.html
Normal file
File diff suppressed because one or more lines are too long
127
www/extras/yui/examples/datatable/dt_localfilter_clean.html
Normal file
127
www/extras/yui/examples/datatable/dt_localfilter_clean.html
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Client-side Filtering of Local Data</title>
|
||||
|
||||
<style type="text/css">
|
||||
/*margin and padding on body element
|
||||
can introduce errors in determining
|
||||
element position and are not recommended;
|
||||
we turn them off as a foundation for YUI
|
||||
CSS treatments. */
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/paginator/assets/skins/sam/paginator.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/paginator/paginator-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
<!--there is no custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Client-side Filtering of Local Data</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<p>Find data quickly and easily with a client-side filter.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
<div class="markup">
|
||||
<label for="filter">Filter by state:</label> <input type="text" id="filter" value="">
|
||||
|
||||
<div id="tbl"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="assets/js/data.js"></script>
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.addListener(window, "load", function() {
|
||||
var Ex = YAHOO.namespace('example');
|
||||
|
||||
Ex.dataSource = new YAHOO.util.DataSource(YAHOO.example.Data.areacodes,{
|
||||
responseType : YAHOO.util.DataSource.TYPE_JSARRAY,
|
||||
responseSchema : {
|
||||
fields : ['areacode','state']
|
||||
},
|
||||
doBeforeCallback : function (req,raw,res,cb) {
|
||||
// This is the filter function
|
||||
var data = res.results || [],
|
||||
filtered = [],
|
||||
i,l;
|
||||
|
||||
if (req) {
|
||||
req = req.toLowerCase();
|
||||
for (i = 0, l = data.length; i < l; ++i) {
|
||||
if (!data[i].state.toLowerCase().indexOf(req)) {
|
||||
filtered.push(data[i]);
|
||||
}
|
||||
}
|
||||
res.results = filtered;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
});
|
||||
|
||||
Ex.cols = [
|
||||
{ key: 'areacode', sortable: true },
|
||||
{ key: 'state', sortable: true }
|
||||
];
|
||||
|
||||
Ex.paginator = new YAHOO.widget.Paginator({
|
||||
rowsPerPage : 10,
|
||||
pageLinks : 5
|
||||
});
|
||||
|
||||
Ex.conf = {
|
||||
paginator : Ex.paginator,
|
||||
sortedBy: {key:'areacode', dir:YAHOO.widget.DataTable.CLASS_ASC}
|
||||
};
|
||||
|
||||
Ex.dataTable = new YAHOO.widget.DataTable('tbl',Ex.cols,Ex.dataSource,Ex.conf);
|
||||
|
||||
Ex.filterTimeout = null;
|
||||
Ex.updateFilter = function () {
|
||||
// Reset timeout
|
||||
Ex.filterTimeout = null;
|
||||
|
||||
// Reset sort
|
||||
var state = Ex.dataTable.getState();
|
||||
state.sortedBy = {key:'areacode', dir:YAHOO.widget.DataTable.CLASS_ASC};
|
||||
|
||||
// Get filtered data
|
||||
Ex.dataSource.sendRequest(YAHOO.util.Dom.get('filter').value,{
|
||||
success : Ex.dataTable.onDataReturnInitializeTable,
|
||||
failure : Ex.dataTable.onDataReturnInitializeTable,
|
||||
scope : Ex.dataTable,
|
||||
argument: state
|
||||
});
|
||||
};
|
||||
|
||||
YAHOO.util.Event.on('filter','keyup',function (e) {
|
||||
clearTimeout(Ex.filterTimeout);
|
||||
setTimeout(Ex.updateFilter,600);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
345
www/extras/yui/examples/datatable/dt_localfilter_log.html
Normal file
345
www/extras/yui/examples/datatable/dt_localfilter_log.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Nested Headers</title>
|
||||
|
||||
|
|
@ -20,7 +22,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/dragdrop/dragdrop-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -28,7 +30,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Nested Headers</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
271
www/extras/yui/examples/datatable/dt_polling.html
Normal file
271
www/extras/yui/examples/datatable/dt_polling.html
Normal file
File diff suppressed because one or more lines are too long
97
www/extras/yui/examples/datatable/dt_polling_clean.html
Normal file
97
www/extras/yui/examples/datatable/dt_polling_clean.html
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Polling the DataSource</title>
|
||||
|
||||
<style type="text/css">
|
||||
/*margin and padding on body element
|
||||
can introduce errors in determining
|
||||
element position and are not recommended;
|
||||
we turn them off as a foundation for YUI
|
||||
CSS treatments. */
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/dragdrop/dragdrop-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
<!--there is no custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Polling the DataSource</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<p>This DataTable polls for data from its DataSource every 5 seconds. Due to browser limitations, implementers should use this feature to replace existing data, rather than continuously add data to the page.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
<div id="polling"></div>
|
||||
|
||||
<script type="text/javascript" src="assets/js/data.js"></script>
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.addListener(window, "load", function() {
|
||||
YAHOO.example.Polling = function() {
|
||||
var counter = 0;
|
||||
var dataIncrementer = function() {
|
||||
counter++;
|
||||
return [{
|
||||
count:counter,
|
||||
description:"At the tone the time will be: ",
|
||||
time: YAHOO.util.Date.format(new Date(), {format:"%I:%M:%S %p"})
|
||||
}]
|
||||
};
|
||||
|
||||
var myColumnDefs = [
|
||||
{key: "count"},
|
||||
{key: "description"},
|
||||
{key: "time"}
|
||||
];
|
||||
|
||||
var myDataSource = new YAHOO.util.DataSource(dataIncrementer);
|
||||
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
||||
myDataSource.responseSchema = {
|
||||
fields: ["count", "description", "time"]
|
||||
};
|
||||
|
||||
var myDataTable = new YAHOO.widget.DataTable("polling",
|
||||
myColumnDefs, myDataSource);
|
||||
|
||||
// Set up polling
|
||||
var myCallback = {
|
||||
success: myDataTable.onDataReturnInitializeTable,
|
||||
failure: function() {
|
||||
YAHOO.log("Polling failure", "error");
|
||||
},
|
||||
scope: myDataTable
|
||||
}
|
||||
myDataSource.setInterval(5000, null, myCallback)
|
||||
|
||||
return {
|
||||
oDS: myDataSource,
|
||||
oDT: myDataTable
|
||||
};
|
||||
}();
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
275
www/extras/yui/examples/datatable/dt_polling_log.html
Normal file
275
www/extras/yui/examples/datatable/dt_polling_log.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Conditional row coloring</title>
|
||||
|
||||
|
|
@ -19,7 +21,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -62,7 +64,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Conditional row coloring</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,166 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Adding and Deleting Rows</title>
|
||||
|
||||
<style type="text/css">
|
||||
/*margin and padding on body element
|
||||
can introduce errors in determining
|
||||
element position and are not recommended;
|
||||
we turn them off as a foundation for YUI
|
||||
CSS treatments. */
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/button/assets/skins/sam/button.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/button/button-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/dragdrop/dragdrop-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
||||
<!--begin custom header content for this example-->
|
||||
<style type="text/css">
|
||||
/* custom styles for this example */
|
||||
#buttons {margin-bottom: 1em;}
|
||||
</style>
|
||||
|
||||
<!--end custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Adding and Deleting Rows</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<p>Adding and deleting rows dynamically.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
<div id="buttons">
|
||||
<span id="addrow" class="yui-button yui-push-button">
|
||||
<span class="first-child">
|
||||
<button type="button">Add one row</button>
|
||||
</span>
|
||||
</span>
|
||||
<span id="deleterow" class="yui-button yui-push-button">
|
||||
<span class="first-child">
|
||||
<button type="button">Delete top row</button>
|
||||
</span>
|
||||
</span>
|
||||
<span id="addrows" class="yui-button yui-push-button">
|
||||
<span class="first-child">
|
||||
<button type="button">Add 20 rows</button>
|
||||
</span>
|
||||
</span>
|
||||
<span id="deleterows" class="yui-button yui-push-button">
|
||||
<span class="first-child">
|
||||
<button type="button" name="button5">Delete top 20 rows</button>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div id="basic"></div>
|
||||
|
||||
<script type="text/javascript" src="assets/js/data.js"></script>
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.addListener(window, "load", function() {
|
||||
YAHOO.example.DynamicData = function() {
|
||||
var data = {one:"one",two:"two",three:"three"};
|
||||
|
||||
var myColumnDefs = [
|
||||
{key:"row",resizeable:true,sortable:true},
|
||||
{key:"one",resizeable:true},
|
||||
{key:"two",resizeable:true},
|
||||
{key:"three",resizeable:true}
|
||||
];
|
||||
|
||||
var myDataSource = new YAHOO.util.DataSource([]);
|
||||
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
||||
myDataSource.responseSchema = {
|
||||
fields: ["one","two","three"]
|
||||
};
|
||||
|
||||
var myDataTable = new YAHOO.widget.DataTable("basic",
|
||||
myColumnDefs, myDataSource, {});
|
||||
|
||||
var i=1,
|
||||
bReverseSorted = false;
|
||||
|
||||
// Track when Column is reverse-sorted, since new data will come in out of order
|
||||
var trackReverseSorts = function(oArg) {
|
||||
bReverseSorted = (oArg.dir === YAHOO.widget.DataTable.CLASS_DESC);
|
||||
};
|
||||
myDataTable.subscribe("columnSortEvent", trackReverseSorts);
|
||||
|
||||
// Add one row to the bottom
|
||||
var btnAddRow = new YAHOO.widget.Button("addrow");
|
||||
btnAddRow.on("click", function() {
|
||||
// Clear sort when necessary
|
||||
if(bReverseSorted) {
|
||||
myDataTable.set("sortedBy", null);
|
||||
}
|
||||
|
||||
var record = YAHOO.widget.DataTable._cloneObject(data);
|
||||
record.row = i++;
|
||||
myDataTable.addRow(record);
|
||||
},this,true);
|
||||
|
||||
// Add 20 rows to the bottom
|
||||
var btnAddRows = new YAHOO.widget.Button("addrows");
|
||||
btnAddRows.on("click", function(e) {
|
||||
// Clear sort when necessary
|
||||
if(bReverseSorted) {
|
||||
myDataTable.set("sortedBy", null);
|
||||
}
|
||||
|
||||
var myArray = [];
|
||||
for(var l=i;i<=l+19;i++) {
|
||||
var record = YAHOO.widget.DataTable._cloneObject(data);
|
||||
record.row = i;
|
||||
myArray.push(record);
|
||||
}
|
||||
myDataTable.addRows(myArray);
|
||||
},this,true);
|
||||
|
||||
// Delete one row from the top
|
||||
var btnDeleteRow = new YAHOO.widget.Button("deleterow");
|
||||
btnDeleteRow.on("click", function() {
|
||||
if(myDataTable.getRecordSet().getLength() > 0) {
|
||||
myDataTable.deleteRow(0);
|
||||
}
|
||||
},this,true);
|
||||
|
||||
// Delete 20 row from the top
|
||||
var btnDeleteRows = new YAHOO.widget.Button("deleterows");
|
||||
btnDeleteRows.on("click", function() {
|
||||
var length = myDataTable.getRecordSet().getLength();
|
||||
if(length > 0) {
|
||||
var count = (length > 19) ? 20 : length;
|
||||
myDataTable.deleteRows(0,count);
|
||||
}
|
||||
},this,true);
|
||||
|
||||
return {
|
||||
oDS: myDataSource,
|
||||
oDT: myDataTable
|
||||
};
|
||||
}();
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
451
www/extras/yui/examples/datatable/dt_rowdatamod.html
Normal file
451
www/extras/yui/examples/datatable/dt_rowdatamod.html
Normal file
File diff suppressed because one or more lines are too long
195
www/extras/yui/examples/datatable/dt_rowdatamod_clean.html
Normal file
195
www/extras/yui/examples/datatable/dt_rowdatamod_clean.html
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Adding, Updating, and Deleting Rows</title>
|
||||
|
||||
<style type="text/css">
|
||||
/*margin and padding on body element
|
||||
can introduce errors in determining
|
||||
element position and are not recommended;
|
||||
we turn them off as a foundation for YUI
|
||||
CSS treatments. */
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/paginator/assets/skins/sam/paginator.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/button/assets/skins/sam/button.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/paginator/paginator-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/button/button-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/dragdrop/dragdrop-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
||||
<!--begin custom header content for this example-->
|
||||
<style type="text/css">
|
||||
/* custom styles for this example */
|
||||
.modform {margin-bottom: 1em;}
|
||||
.index {width:5em;}
|
||||
</style>
|
||||
|
||||
<!--end custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Adding, Updating, and Deleting Rows</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<p>Adding, updating, and deleting row data dynamically.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
<form class="modform">
|
||||
<select id="mode">
|
||||
<option value="add">Add</option>
|
||||
<option value="update">Update</option>
|
||||
<option value="deletestandard">Delete top-to-bottom</option>
|
||||
<option value="deletereverse">Delete bottom-up</option>
|
||||
</select>
|
||||
|
||||
<select id="count">
|
||||
<option value=1>1</option>
|
||||
<option value=5>5</option>
|
||||
<option value=10>10</option>
|
||||
<option value=25>25</option>
|
||||
<option value=100>100</option>
|
||||
</select>
|
||||
|
||||
row(s) at index
|
||||
|
||||
<input id="index" type="text" value="0" class="index">
|
||||
|
||||
<span id="go" class="yui-button yui-push-button">
|
||||
<span class="first-child">
|
||||
<button type="button">Go!</button>
|
||||
</span>
|
||||
</span>
|
||||
</form>
|
||||
|
||||
<div id="container"></div>
|
||||
|
||||
<script type="text/javascript" src="assets/js/data.js"></script>
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.addListener(window, "load", function() {
|
||||
YAHOO.example.RowDataMod = function() {
|
||||
var myColumnDefs = [
|
||||
{key:"row", label:"row counter", resizeable:true,sortable:true},
|
||||
{key:"one",resizeable:true},
|
||||
{key:"two",resizeable:true},
|
||||
{key:"three",resizeable:true}
|
||||
];
|
||||
|
||||
var myDataSource = new YAHOO.util.DataSource([]);
|
||||
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
||||
myDataSource.responseSchema = {
|
||||
fields: ["one","two","three"]
|
||||
};
|
||||
|
||||
var myDataTable = new YAHOO.widget.DataTable("container",
|
||||
myColumnDefs, myDataSource, {});
|
||||
|
||||
var i=1,
|
||||
bReverseSorted = false;
|
||||
|
||||
// Track when Column is reverse-sorted, since new data will come in out of order
|
||||
var trackReverseSorts = function(oArg) {
|
||||
bReverseSorted = (oArg.dir === YAHOO.widget.DataTable.CLASS_DESC);
|
||||
};
|
||||
|
||||
var globalDataCount = -1,
|
||||
getData = function(count) {
|
||||
if(count) {
|
||||
var allData = [];
|
||||
for(var i=0; i<count; i++) {
|
||||
globalDataCount++;
|
||||
allData.push({row:globalDataCount, one:"one", two:"two", three:"three"});
|
||||
}
|
||||
return allData;
|
||||
}
|
||||
else {
|
||||
globalDataCount++;
|
||||
return {row:globalDataCount, one:"one", two:"two", three:"three"};
|
||||
}
|
||||
};
|
||||
|
||||
// Add/update/delete rows as indicated
|
||||
var handleClick = function() {
|
||||
// Reset sort
|
||||
myDataTable.set("sortedBy", null);
|
||||
|
||||
var mode = YAHOO.util.Dom.get("mode").value,
|
||||
count = parseInt(YAHOO.util.Dom.get("count").value),
|
||||
index = parseInt(YAHOO.util.Dom.get("index").value);
|
||||
|
||||
if(YAHOO.lang.isNumber(index)) {
|
||||
switch(mode) {
|
||||
case "add":
|
||||
if(count === 1) {
|
||||
myDataTable.addRow(getData(), index);
|
||||
}
|
||||
else {
|
||||
myDataTable.addRows(getData(count), index);
|
||||
}
|
||||
return;
|
||||
case "update":
|
||||
if(count === 1) {
|
||||
myDataTable.updateRow(index, getData());
|
||||
}
|
||||
else {
|
||||
myDataTable.updateRows(index, getData(count));
|
||||
}
|
||||
return;
|
||||
case "deletestandard":
|
||||
if(count === 1) {
|
||||
myDataTable.deleteRow(index);
|
||||
}
|
||||
else {
|
||||
myDataTable.deleteRows(index, count);
|
||||
}
|
||||
return;
|
||||
case "deletereverse":
|
||||
if(count === 1) {
|
||||
myDataTable.deleteRow(index, -1);
|
||||
}
|
||||
else {
|
||||
myDataTable.deleteRows(index, count*-1);
|
||||
}
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
YAHOO.log("Could not continue due to invalid index.");
|
||||
}
|
||||
|
||||
var btn = new YAHOO.widget.Button("go");
|
||||
btn.on("click", handleClick);
|
||||
|
||||
return {
|
||||
ds: myDataSource,
|
||||
dt: myDataTable
|
||||
};
|
||||
}();
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
455
www/extras/yui/examples/datatable/dt_rowdatamod_log.html
Normal file
455
www/extras/yui/examples/datatable/dt_rowdatamod_log.html
Normal file
File diff suppressed because one or more lines are too long
1114
www/extras/yui/examples/datatable/dt_rowexp_basic.html
Normal file
1114
www/extras/yui/examples/datatable/dt_rowexp_basic.html
Normal file
File diff suppressed because one or more lines are too long
544
www/extras/yui/examples/datatable/dt_rowexp_basic_clean.html
Normal file
544
www/extras/yui/examples/datatable/dt_rowexp_basic_clean.html
Normal file
|
|
@ -0,0 +1,544 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Row Expansion</title>
|
||||
|
||||
<style type="text/css">
|
||||
/*margin and padding on body element
|
||||
can introduce errors in determining
|
||||
element position and are not recommended;
|
||||
we turn them off as a foundation for YUI
|
||||
CSS treatments. */
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/connection/connection-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/json/json-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
||||
<!--begin custom header content for this example-->
|
||||
<style type="text/css">
|
||||
/* custom styles for this example */
|
||||
#expandable_table{width:500px;}
|
||||
|
||||
/**
|
||||
*
|
||||
* Style the yui-dt-expandablerow-trigger column
|
||||
*
|
||||
**/
|
||||
.yui-dt-expandablerow-trigger{
|
||||
width:18px;
|
||||
height:22px;
|
||||
cursor:pointer;
|
||||
}
|
||||
.yui-dt-expanded .yui-dt-expandablerow-trigger{
|
||||
background:url(../datatable/assets/images/arrow_open.png) 4px 4px no-repeat;
|
||||
}
|
||||
.yui-dt-expandablerow-trigger, .yui-dt-collapsed .yui-dt-expandablerow-trigger{
|
||||
background:url(../datatable/assets/images/arrow_closed.png) 4px 4px no-repeat;
|
||||
}
|
||||
.yui-dt-expanded .yui-dt-expandablerow-trigger.spinner{
|
||||
background:url(../datatable/assets/img/spinner.gif) 1px 4px no-repeat;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--end custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
<cite class="byline">DataTable Row Expansion was developed by <a href='http://standardpixel.com'>Eric Gelinas</a>. This was originally a concept for <a href='http://apt.yahoo.com/'>Yahoo! APT</a> by Ryan Leffel with designs by Edward Zee.</cite>
|
||||
|
||||
<h1>Row Expansion</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<!-- Introductory text -->
|
||||
<p>A demonstration of the DataTable's row expansion feature to display a list of "Interestingness" from <a href="flickr.com">Flickr</a>. When the table first loads, it displays a list of image titles. When a row is expanded the photo is displayed in the expansion area along with a link to the Flickr user's photostream. This example uses a simple string-based template to format the row expansion area.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
|
||||
<div id="expandable_table"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* This code should not be modified */
|
||||
/**********
|
||||
*
|
||||
* Row Expansion Plugin for the YUI DataTable
|
||||
* Author: gelinase@yahoo-inc.com / Eric Gelinas
|
||||
* @submodule Row Expansion
|
||||
* @class YAHOO.widget.DataTable
|
||||
***********/
|
||||
|
||||
(function(){
|
||||
var Dom = YAHOO.util.Dom,
|
||||
STRING_STATENAME = 'yui_dt_state',
|
||||
CLASS_EXPANDED = 'yui-dt-expanded',
|
||||
CLASS_COLLAPSED = 'yui-dt-collapsed',
|
||||
CLASS_EXPANSION = 'yui-dt-expansion',
|
||||
CLASS_LINER = 'yui-dt-liner',
|
||||
|
||||
//From YUI 3
|
||||
indexOf = function(a, val) {
|
||||
for (var i=0; i<a.length; i=i+1) {
|
||||
if (a[i] === val) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
||||
|
||||
YAHOO.lang.augmentObject(
|
||||
YAHOO.widget.DataTable.prototype ,
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Private members
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Gets state object for a specific record associated with the DataTable.
|
||||
* @method _getRecordState
|
||||
* @param {Mixed} record_id Record / Row / or Index id
|
||||
* @param {String} key Key to return within the state object. Default is to
|
||||
* return all as a map
|
||||
* @return {Object} State data object
|
||||
* @type mixed
|
||||
* @private
|
||||
**/
|
||||
_getRecordState : function( record_id, key ){
|
||||
|
||||
var row_data = this.getRecord( record_id ),
|
||||
row_state = row_data.getData( STRING_STATENAME ),
|
||||
state_data = ( row_state && key ) ? row_state[ key ] : row_state;
|
||||
|
||||
return state_data || {};
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets a value to a state object with a unique id for a record which
|
||||
* is associated with the DataTable
|
||||
* @method _setRecordState
|
||||
* @param {Mixed} record_id Record / Row / or Index id
|
||||
* @param {String} key Key to use in map
|
||||
* @param {Mixed} value Value to assign to the key
|
||||
* @return {Object} State data object
|
||||
* @type mixed
|
||||
* @private
|
||||
**/
|
||||
_setRecordState : function( record_id, key, value ){
|
||||
|
||||
var row_data = this.getRecord( record_id ).getData(),
|
||||
merged_data = row_data[ STRING_STATENAME ] || {};
|
||||
|
||||
merged_data[ key ] = value;
|
||||
|
||||
this.getRecord( record_id ).setData( STRING_STATENAME, merged_data );
|
||||
|
||||
return merged_data;
|
||||
|
||||
},
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Public methods
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Over-ridden initAttributes method from DataTable
|
||||
* @method initAttributes
|
||||
* @param {Mixed} record_id Record / Row / or Index id
|
||||
* @param {String} key Key to use in map
|
||||
* @param {Mixed} value Value to assign to the key
|
||||
* @return {Object} State data object
|
||||
* @type mixed
|
||||
**/
|
||||
initAttributes : function( oConfigs ) {
|
||||
|
||||
oConfigs = oConfigs || {};
|
||||
|
||||
YAHOO.widget.DataTable.superclass.initAttributes.call( this, oConfigs );
|
||||
|
||||
/**
|
||||
* @attribute rowExpansionTemplate
|
||||
* @description Value for the rowExpansionTemplate attribute.
|
||||
* @type {Mixed}
|
||||
* @default ""
|
||||
**/
|
||||
this.setAttributeConfig("rowExpansionTemplate", {
|
||||
value: "",
|
||||
validator: function( template ){
|
||||
return (
|
||||
YAHOO.lang.isString( template ) ||
|
||||
YAHOO.lang.isFunction( template )
|
||||
);
|
||||
},
|
||||
method: this.initRowExpansion
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Initializes row expansion on the DataTable instance
|
||||
* @method initRowExpansion
|
||||
* @param {Mixed} template a string template or function to be called when
|
||||
* Row is expanded
|
||||
* @type mixed
|
||||
**/
|
||||
initRowExpansion : function( template ){
|
||||
|
||||
//Set subscribe restore method
|
||||
this.subscribe( 'postRenderEvent', this.onEventRestoreRowExpansion );
|
||||
|
||||
//Setup template
|
||||
this.rowExpansionTemplate = template;
|
||||
|
||||
//Set table level state
|
||||
this.a_rowExpansions = [];
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggles the expansion state of a row
|
||||
* @method toggleRowExpansion
|
||||
* @param {Mixed} record_id Record / Row / or Index id
|
||||
* @type mixed
|
||||
**/
|
||||
toggleRowExpansion : function( record_id ){
|
||||
|
||||
var state = this._getRecordState( record_id );
|
||||
|
||||
if( state && state.expanded ){
|
||||
|
||||
this.collapseRow( record_id );
|
||||
|
||||
} else {
|
||||
|
||||
this.expandRow( record_id );
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the expansion state of a row to expanded
|
||||
* @method expandRow
|
||||
* @param {Mixed} record_id Record / Row / or Index id
|
||||
* @param {Boolean} restore will restore an exisiting state for a
|
||||
* row that has been collapsed by a non user action
|
||||
* @return {Boolean} successful
|
||||
* @type mixed
|
||||
**/
|
||||
expandRow : function( record_id, restore ){
|
||||
|
||||
var state = this._getRecordState( record_id );
|
||||
|
||||
if( !state.expanded || restore ){
|
||||
|
||||
var row_data = this.getRecord( record_id ),
|
||||
row = this.getRow( row_data ),
|
||||
new_row = document.createElement('tr'),
|
||||
column_length = this.getFirstTrEl().childNodes.length,
|
||||
expanded_data = row_data.getData(),
|
||||
expanded_content = null,
|
||||
template = this.rowExpansionTemplate,
|
||||
next_sibling = Dom.getNextSibling( row );
|
||||
|
||||
//Construct expanded row body
|
||||
new_row.className = CLASS_EXPANSION;
|
||||
var new_column = document.createElement( 'td' );
|
||||
new_column.colSpan = column_length;
|
||||
|
||||
new_column.innerHTML = '<div class="'+ CLASS_LINER +'"></div>';
|
||||
new_row.appendChild( new_column );
|
||||
|
||||
var liner_element = new_row.firstChild.firstChild;
|
||||
|
||||
if( YAHOO.lang.isString( template ) ){
|
||||
|
||||
liner_element.innerHTML = YAHOO.lang.substitute(
|
||||
template,
|
||||
expanded_data
|
||||
);
|
||||
|
||||
} else if( YAHOO.lang.isFunction( template ) ) {
|
||||
|
||||
template( {
|
||||
row_element : new_row,
|
||||
liner_element : liner_element,
|
||||
data : row_data,
|
||||
state : state
|
||||
|
||||
} );
|
||||
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
//Insert new row
|
||||
newRow = Dom.insertAfter( new_row, row );
|
||||
|
||||
if (newRow.innerHTML.length) {
|
||||
|
||||
this._setRecordState( record_id, 'expanded', true );
|
||||
|
||||
if( !restore ){
|
||||
|
||||
this.a_rowExpansions.push( this.getRecord( record_id ).getId() );
|
||||
|
||||
}
|
||||
|
||||
Dom.removeClass( row, CLASS_COLLAPSED );
|
||||
Dom.addClass( row, CLASS_EXPANDED );
|
||||
|
||||
//Fire custom event
|
||||
this.fireEvent( "rowExpandEvent", { record_id : row_data.getId() } );
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the expansion state of a row to collapsed
|
||||
* @method collapseRow
|
||||
* @param {Mixed} record_id Record / Row / or Index id
|
||||
* @return {Boolean} successful
|
||||
* @type mixed
|
||||
**/
|
||||
collapseRow : function( record_id ){
|
||||
|
||||
var row_data = this.getRecord( record_id ),
|
||||
row = Dom.get( row_data.getId() ),
|
||||
state = row_data.getData( STRING_STATENAME );
|
||||
|
||||
if( state && state.expanded ){
|
||||
|
||||
var next_sibling = Dom.getNextSibling( row ),
|
||||
hash_index = indexOf( this.a_rowExpansions, record_id );
|
||||
|
||||
if( Dom.hasClass( next_sibling, CLASS_EXPANSION ) ) {
|
||||
|
||||
next_sibling.parentNode.removeChild( next_sibling );
|
||||
this.a_rowExpansions.splice( hash_index, 1 );
|
||||
this._setRecordState( record_id, 'expanded', false );
|
||||
|
||||
Dom.addClass( row, CLASS_COLLAPSED );
|
||||
Dom.removeClass( row, CLASS_EXPANDED );
|
||||
|
||||
//Fire custom event
|
||||
this.fireEvent("rowCollapseEvent", { record_id : row_data.getId() } );
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Collapses all expanded rows. This should be called before any action where
|
||||
* the row expansion markup would interfear with normal DataTable markup handling.
|
||||
* This method does not remove exents attached during implementation. All event
|
||||
* handlers should be removed separately.
|
||||
* @method collapseAllRows
|
||||
* @type mixed
|
||||
**/
|
||||
collapseAllRows : function(){
|
||||
|
||||
var rows = this.a_rowExpansions;
|
||||
|
||||
for( var i = 0, l = rows.length; l > i; i++ ){
|
||||
|
||||
//Always pass 0 since collapseRow removes item from the a_rowExpansions array
|
||||
this.collapseRow( rows[ 0 ] );
|
||||
|
||||
}
|
||||
|
||||
a_rowExpansions = [];
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Restores rows which have an expanded state but no markup. This
|
||||
* is to be called to restore row expansions after the DataTable
|
||||
* renders or the collapseAllRows is called.
|
||||
* @method collapseAllRows
|
||||
* @type mixed
|
||||
**/
|
||||
restoreExpandedRows : function(){
|
||||
|
||||
var expanded_rows = this.a_rowExpansions;
|
||||
|
||||
if( !expanded_rows.length ){
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if( this.a_rowExpansions.length ){
|
||||
|
||||
for( var i = 0, l = expanded_rows.length; l > i; i++ ){
|
||||
|
||||
this.expandRow( expanded_rows[ i ] , true );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Abstract method which restores row expansion for subscribing to the
|
||||
* DataTable postRenderEvent.
|
||||
* @method onEventRestoreRowExpansion
|
||||
* @param {Object} oArgs context of a subscribed event
|
||||
* @type mixed
|
||||
**/
|
||||
onEventRestoreRowExpansion : function( oArgs ){
|
||||
|
||||
this.restoreExpandedRows();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Abstract method which toggles row expansion for subscribing to the
|
||||
* DataTable postRenderEvent.
|
||||
* @method onEventToggleRowExpansion
|
||||
* @param {Object} oArgs context of a subscribed event
|
||||
* @type mixed
|
||||
**/
|
||||
onEventToggleRowExpansion : function( oArgs ){
|
||||
|
||||
if( YAHOO.util.Dom.hasClass( oArgs.target, 'yui-dt-expandablerow-trigger' ) ){
|
||||
|
||||
this.toggleRowExpansion( oArgs.target );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}, true //This boolean is needed to override members of the original object
|
||||
);
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* Modify as needed */
|
||||
YAHOO.util.Event.onDOMReady( function() {
|
||||
YAHOO.example.Basic = function() {
|
||||
|
||||
/**
|
||||
*
|
||||
* Create a YUI DataSource instance. This will create an XHR datasource and will use YQL
|
||||
* to query the Flickr web service.
|
||||
*
|
||||
**/
|
||||
var myDataSource = new YAHOO.util.DataSource('assets/php/yql_proxy.php?q=select%20*%20from%20flickr.photos.interestingness(20)&format=json');
|
||||
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
|
||||
myDataSource.connXhrMode = "queueRequests";
|
||||
myDataSource.responseSchema = {
|
||||
resultsList: "query.results.photo"
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Create a YUI DataTable instance.
|
||||
*
|
||||
**/
|
||||
var myDataTable = new YAHOO.widget.DataTable(
|
||||
"expandable_table",
|
||||
[
|
||||
{
|
||||
label:"",
|
||||
/**
|
||||
* This formatter adds a class that will be used to style a
|
||||
* trigger in the first column
|
||||
**/
|
||||
formatter:function( el, oRecord, oColumn, oData ) {
|
||||
|
||||
YAHOO.util.Dom.addClass( el.parentNode, "yui-dt-expandablerow-trigger" );
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
key:"title",
|
||||
label:"Interestingness",
|
||||
width : '200px',
|
||||
/**
|
||||
* This formatter includes a default string in cells where the record
|
||||
* is missing a title. This just makes the finsished product look nicer.
|
||||
**/
|
||||
formatter: function( el, oRecord, oColumn, oData ){
|
||||
|
||||
el.innerHTML = oData || '--[ No description ]--';
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
myDataSource,
|
||||
{
|
||||
/**
|
||||
* The "rowExpansionTemplate" property is passed a string. This is passed
|
||||
* through YAHOO.lang.substitute which can match tokens (represented with brackets),
|
||||
* which contain keys from the DataTables data.
|
||||
**/
|
||||
rowExpansionTemplate : '<img src="http://farm{farm}.static.flickr.com/{server}/{id}_{secret}_m_d.jpg" /><div><a href="http://flickr.com/photos/{owner}">See more photos from this Flickr User</a></div>'
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* Subscribe to the "cellClickEvent" which will yui-dt-expandablerow-trigger the expansion
|
||||
* when the user clicks on the yui-dt-expandablerow-trigger column
|
||||
*
|
||||
**/
|
||||
myDataTable.subscribe( 'cellClickEvent', myDataTable.onEventToggleRowExpansion );
|
||||
|
||||
return {
|
||||
oDS: myDataSource,
|
||||
oDT: myDataTable
|
||||
};
|
||||
}();
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1118
www/extras/yui/examples/datatable/dt_rowexp_basic_log.html
Normal file
1118
www/extras/yui/examples/datatable/dt_rowexp_basic_log.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Row Selection</title>
|
||||
|
||||
|
|
@ -19,7 +21,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -35,7 +37,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>Row Selection</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
284
www/extras/yui/examples/datatable/dt_tabview.html
Normal file
284
www/extras/yui/examples/datatable/dt_tabview.html
Normal file
File diff suppressed because one or more lines are too long
104
www/extras/yui/examples/datatable/dt_tabview_clean.html
Normal file
104
www/extras/yui/examples/datatable/dt_tabview_clean.html
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>TabView Integration</title>
|
||||
|
||||
<style type="text/css">
|
||||
/*margin and padding on body element
|
||||
can introduce errors in determining
|
||||
element position and are not recommended;
|
||||
we turn them off as a foundation for YUI
|
||||
CSS treatments. */
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/tabview/assets/skins/sam/tabview.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/tabview/tabview-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
<!--there is no custom header content for this example-->
|
||||
|
||||
</head>
|
||||
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>TabView Integration</h1>
|
||||
|
||||
<div class="exampleIntro">
|
||||
<p>Integrating DataTable with the TabView widget.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
|
||||
<div id="tvcontainer" class="yui-navset">
|
||||
<ul class="yui-nav">
|
||||
<li class="selected"><a href="#tab1"><em>Start Tab</em></a></li>
|
||||
<li><a href="#tab2"><em>DataTable Tab</em></a></li>
|
||||
<li><a href="#tab3"><em>Another Tab</em></a></li>
|
||||
|
||||
</ul>
|
||||
<div class="yui-content">
|
||||
|
||||
<div><p>Welcome! There is a DataTable in the second Tab.</p></div>
|
||||
<div id="dtcontainer"></div>
|
||||
<div><p>This is another Tab.</p></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="assets/js/data.js"></script>
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.addListener(window, "load", function() {
|
||||
YAHOO.example.TabView = function() {
|
||||
|
||||
var myColumnDefs = [
|
||||
{key:"id", sortable:true},
|
||||
{key:"date", formatter:YAHOO.widget.DataTable.formatDate, sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC}},
|
||||
{key:"quantity", formatter:YAHOO.widget.DataTable.formatNumber, sortable:true},
|
||||
{key:"amount", formatter:YAHOO.widget.DataTable.formatCurrency, sortable:true},
|
||||
{key:"title", sortable:true},
|
||||
{key:"description"}
|
||||
];
|
||||
|
||||
var myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.bookorders);
|
||||
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
||||
myDataSource.responseSchema = {
|
||||
fields: ["id","date","quantity","amount","title","description"]
|
||||
};
|
||||
|
||||
var myDataTable =
|
||||
new YAHOO.widget.DataTable("dtcontainer", myColumnDefs, myDataSource,{scrollable:true,width:"100%"});
|
||||
|
||||
var myTabView = new YAHOO.widget.TabView("tvcontainer");
|
||||
myTabView.getTab(1).addListener("click", function() {myDataTable.onShow()});
|
||||
|
||||
return {
|
||||
oDS: myDataSource,
|
||||
oDT: myDataTable,
|
||||
oTV: myTabView
|
||||
};
|
||||
}();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
288
www/extras/yui/examples/datatable/dt_tabview_log.html
Normal file
288
www/extras/yui/examples/datatable/dt_tabview_log.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>JSON Data Over XHR</title>
|
||||
|
||||
|
|
@ -21,7 +23,7 @@ body {
|
|||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/connection/connection-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/json/json-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -29,7 +31,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>JSON Data Over XHR</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>XML Data Over XHR With POST</title>
|
||||
|
||||
|
|
@ -20,7 +22,7 @@ body {
|
|||
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
||||
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
||||
<script type="text/javascript" src="../../build/connection/connection-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
||||
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
||||
|
||||
|
|
@ -28,7 +30,7 @@ body {
|
|||
|
||||
</head>
|
||||
|
||||
<body class=" yui-skin-sam">
|
||||
<body class="yui-skin-sam">
|
||||
|
||||
|
||||
<h1>XML Data Over XHR With POST</h1>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue