Statistics | ||||
---|---|---|---|---|
Visits | Views | |||
Loading... | ||||
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 |
Data:
1 | YAHOO.example.Data = { |
2 | webstats: [ |
3 | ["home.html",20,400,44,657], |
4 | ["blog.html",24,377,97,567], |
5 | ["contact.html",32,548,42,543], |
6 | ["about.html",8,465,12,946], |
7 | ["pagenotfound.html",0,0,0,0] |
8 | ] |
9 | } |
view plain | print | ? |
CSS:
1 | /* No custom CSS. */ |
view plain | print | ? |
Markup:
1 | <div id="nested"></div> |
view plain | print | ? |
JavaScript:
1 | YAHOO.util.Event.addListener(window, "load", function() { |
2 | YAHOO.example.NestedHeaders = new function() { |
3 | var myColumnDefs = [ |
4 | {key:"page", label:"Page", sortable:true, resizeable:true}, |
5 | {label:"Statistics", formatter:YAHOO.widget.DataTable.formatNumber, children:[ |
6 | {label:"Visits", |
7 | children: [ |
8 | {key:"visitsmonth", label:"This Month",sortable:true, resizeable:true}, |
9 | {key:"visitsytd", label:"YTD", abbr:"Year to Date",sortable:true, resizeable:true} |
10 | ] |
11 | }, |
12 | {label:"Views", |
13 | children: [ |
14 | {key:"viewsmonth", label:"This Month",sortable:true, resizeable:true}, |
15 | {key:"viewsytd", label:"YTD", abbr:"Year to Date",sortable:true, resizeable:true} |
16 | ] |
17 | |
18 | } |
19 | ]} |
20 | ]; |
21 | |
22 | this.myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.webstats); |
23 | this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; |
24 | this.myDataSource.responseSchema = { |
25 | fields: ["page","visitsmonth","visitsytd","viewsmonth","viewsytd"] |
26 | }; |
27 | |
28 | this.myDataTable = new YAHOO.widget.DataTable("nested", myColumnDefs, this.myDataSource); |
29 | }; |
30 | }); |
view plain | print | ? |
You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.
INFO 589ms (+589) 10:14:49 AM:
LogReader instance0
LogReader initialized
INFO 0ms (+0) 10:14:49 AM:
global
Logger initialized
Note: You are viewing this example in debug mode with logging enabled. This can significantly slow performance.
Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings