/* Copyright (c) 2004-2006, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/community/licensing.shtml */ dojo.provide("dojo.widget.html.SortableTable"); dojo.require("dojo.lang"); dojo.require("dojo.date"); dojo.require("dojo.html"); dojo.require("dojo.event.*"); dojo.require("dojo.widget.HtmlWidget"); dojo.require("dojo.widget.SortableTable"); dojo.widget.html.SortableTable=function(){ // summary // Constructor for the SortableTable widget dojo.widget.SortableTable.call(this); dojo.widget.HtmlWidget.call(this); this.headClass=""; this.tbodyClass=""; this.headerClass=""; this.headerSortUpClass="selected"; this.headerSortDownClass="selected"; this.rowClass=""; this.rowAlternateClass="alt"; this.rowSelectedClass="selected"; this.columnSelected="sorted-column"; }; dojo.inherits(dojo.widget.html.SortableTable, dojo.widget.HtmlWidget); dojo.lang.extend(dojo.widget.html.SortableTable, { templatePath:null, templateCssPath:null, getTypeFromString:function(/* string */ s){ // summary // Find the constructor that matches param s by searching through the entire object tree. var parts=s.split("."),i=0,obj=dj_global; do{obj=obj[parts[i++]];}while(i=0){ this.selected.splice(idx,1); } }, getSelection:function(){ // summary // return the array of currently selected objects (JSON format) return this.selected; // array }, getValue:function(){ // summary // return a comma-delimited list of selected valueFields. var a=[]; for(var i=0;ib[field]) return 1; if (a[field]0) body.removeChild(body.childNodes[0]); for(var i=0; i0 && data.length0){ thead.className=this.headClass; } // disable selections dojo.html.disableSelection(this.domNode); // parse the columns. this.parseColumns(thead); // attach header handlers. var header="td"; if(thead.getElementsByTagName(header).length==0) header="th"; var headers=thead.getElementsByTagName(header); for(var i=0; i0) { tbody.className=this.tbodyClass; } this.parseDataFromTable(tbody); this.render(true); } });