Home | History | Annotate | Download | only in tools

Lines Matching refs:Table

64 table.meta_table
77 table.meta_table td
87 table.stats
100 table.stats td{
109 table.stats th{
117 table.stats td.top{
127 table.stats th.table-sorted-asc{
133 table.stats th.table-sorted-desc{
139 table.stats2
147 table.stats2 td{
195 * Table.js
321 * The main Table namespace
323 var Table = (function(){
418 // The table object itself
419 var table = {
421 AutoStripeClassName:"table-autostripe",
422 StripeClassNamePrefix:"table-stripeclass:",
424 AutoSortClassName:"table-autosort",
425 AutoSortColumnPrefix:"table-autosort:",
427 SortedAscendingClassName:"table-sorted-asc",
428 SortedDescendingClassName:"table-sorted-desc",
429 SortableClassName:"table-sortable",
430 SortableColumnPrefix:"table-sortable:",
431 NoSortClassName:"table-nosort",
433 AutoFilterClassName:"table-autofilter",
434 FilteredClassName:"table-filtered",
435 FilterableClassName:"table-filterable",
436 FilteredRowcountPrefix:"table-filtered-rowcount:",
437 RowcountPrefix:"table-rowcount:",
440 AutoPageSizePrefix:"table-autopage:",
441 AutoPageJumpPrefix:"table-page:",
442 PageNumberPrefix:"table-page-number:",
443 PageCountPrefix:"table-page-count:"
447 * A place to store misc table information, rather than in the table objects themselves
449 table.tabledata = {};
452 * Resolve a table given an element reference, and make sure it has a unique ID
454 table.uniqueId=1;
455 table.resolve = function(o,args) {
456 if (o!=null && o.nodeName && o.nodeName!="TABLE") {
457 o = getParent(o,"TABLE");
462 do { var id = "TABLE_"+(table.uniqueId++); }
475 * Run a function against each cell in a table header or footer, usually
478 table.processTableCells = function(t, type, func, arg) {
492 table cells.
494 table.processCells = function(section,func,arg) {
518 table.getCellIndex = function(td) {
542 table.nodeValue = {
565 table.getCellValue = function(td,useInnerText) {
601 * Consider colspan and rowspan values in table header cells to calculate the actual cellIndex
607 table.tableHeaderIndexes = {};
608 table.getActualCellIndex = function(tableCellObj) {
610 var tableObj = getParent(tableCellObj,"TABLE");
613 // If it has already been computed, return the answer from the lookup table
667 table.sort = function(o,args) {
682 // Resolve the table
713 if (tdata.col==table.getActualCellIndex(cell) && (classValue(cell,table.SortableClassName))) {
736 if(!hasClass(tb,table.NoSortClassName)) {
766 // If paging is enabled on the table, then we need to re-page because the order of rows has changed!
779 * Apply a filter to rows in a table and hide those that do not match.
781 table.filter = function(o,filters,args) {
788 // If new filters were passed in, apply them to the table's list of filters
790 // If a null or blank value was sent in for 'filters' then that means reset the table to no filters
821 // If some non-table object was passed in rather than a 'col' value, resolve it
823 // passing in a cell reference or a select object etc instead of a table object
829 // Apply the passed-in filters to the existing list of filters for the table, removing those that have a filter of null or ""
844 // Everything's been setup, so now scrape the table rows
845 return table.scrape(o);
849 * "Page" a table by showing only a subset of the rows
851 table.page = function(t,page,args) {
854 return table.scrape(t,args);
860 table.pageJump = function(t,count,args) {
862 return this.page(t,(table.tabledata[t.id].page||0)+count,args);
866 * Go to the next page of a paged table
868 table.pageNext = function(t,args) {
873 * Go to the previous page of a paged table
875 table.pagePrevious = function(t,args) {
880 * Scrape a table to either hide or show each row based on filters and paging
882 table.scrape = function(o,args) {
889 // Resolve the table object
969 ((tdata.filters && def(tdata.filters[table.getCellIndex(c)]) && hasClass(c,table.FilterableClassName))?addClass:removeClass)(c,table.FilteredClassName);
973 // Stripe the table if necessary
1001 * Shade alternate rows, aka Stripe the table.
1003 table.stripe = function(t,className,args) {
1041 * Build up a list of unique values in a table column
1043 table.getUniqueColValues = function(t,col) {
1060 * based on existence of class names on the table and cells.
1062 table.auto = function(args) {
1063 var cells = [], tables = document.getElementsByTagName("TABLE");
1067 var t = table.resolve(tables[i]);
1068 tdata = table.tabledata[t.id];
1069 if (val=classValue(t,table.StripeClassNamePrefix)) {
1073 if (hasClass(t,table.AutoFilterClassName)) {
1074 table.autofilter(t);
1077 if (val = classValue(t,table.AutoPageSizePrefix)) {
1078 table.autopage(t,{'pagesize':+val});
1081 if ((val = classValue(t,table.AutoSortColumnPrefix)) || (hasClass(t,table.AutoSortClassName))) {
1082 table.autosort(t,{'col':(val==null)?null:+val});
1085 if (tdata.stripeclass && hasClass(t,table.AutoStripeClassName)) {
1086 table.stripe(t);
1093 * Add sorting functionality to a table header cell
1095 table.autosort = function(t,args) {
1099 var type = classValue(c,table.SortableColumnPrefix);
1102 c.title =c.title || table.AutoSortTitle;
1103 addClass(c,table.SortableClassName);
1104 c.onclick = Function("","Table.sort(this,{'sorttype':Sort['"+type+"']})");
1107 if (args.col==table.getActualCellIndex(c)) {
1114 table.sort(t,args);
1119 * Add paging functionality to a table
1121 table.autopage = function(t,args) {
1126 var type = classValue(c,table.AutoPageJumpPrefix);
1130 c.onclick = Function("","Table.pageJump(this,"+type+")");
1133 if (val = classValue(t,table.PageNumberPrefix)) {
1136 if (val = classValue(t,table.PageCountPrefix)) {
1139 return table.page(t,0,args);
1146 table.cancelBubble = function(e) {
1153 * Auto-filter a table
1155 table.autofilter = function(t,args) {
1159 table.processTableCells(t, "THEAD", function(cell) {
1160 if (hasClass(cell,table.FilterableClassName)) {
1161 var cellIndex = table.getCellIndex(cell);
1162 var colValues = table.getUniqueColValues(t,cellIndex);
1168 var sel = '<select onchange="Table.filter(this,this)" onclick="Table.cancelBubble(event)" class="'+table.AutoFilterClassName+'"><option value="">'+table.FilterAllLabel+'</option>';
1178 if (val = classValue(t,table.FilteredRowcountPrefix)) {
1181 if (val = classValue(t,table.RowcountPrefix)) {
1191 jQuery(table.auto);
1194 window.addEventListener( "load", table.auto, false );
1197 window.attachEvent( "onload", table.auto );
1200 return table;
1447 print >> output, '<table class="stats2">'
1455 print >> output, '</table>'
1460 print >> output, '<h2 id=\"comment\">click on table headers to asc/desc sort</h2>'
1461 result_table_prefix = """<table
1462 id="t1" class="stats table-autosort:4 table-autofilter table-stripeclass:alternate table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount">
1463 <thead class="th table-sorted-asc table-sorted-desc">
1465 <th align="left" class="table-sortable:alphanumeric">Date/Time</th>
1466 <th align="left" class="filterable table-sortable:alphanumeric">Test Case<br><input name="tc_filter" size="10" onkeyup="Table.filter(this,this)" onclick="Table.cancelBubble(event)"></th>
1467 <th align="left" class="table-filterable table-sortable:alphanumeric">Status</th>
1514 print >> output, "</tbody></table>"
1533 print >> output, '<ul><table class="meta_table"><tr><td align="left">%s</td></tr></table></ul></li>' % val