/* * Copyright 2007-2011 Charles du Jeu * This file is part of AjaXplorer. * * AjaXplorer is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * AjaXplorer is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with AjaXplorer. If not, see . * * The latest code can be found at . */ /** * AjaXplorer Encapsulation of the Sortable Table */ Class.create("AjxpSortable", SortableTable, { /** * Constructor * @param $super klass Superclass * @param oTable HTMLElement Table tag * @param oSortTypes Array The sort types of the defined columns * @param oTHead HTMLElement The Head of the columns */ initialize: function($super, oTable, oSortTypes, oTHead) { $super(oTable, oSortTypes, oTHead); this.addSortType( "NumberK", this.replace8a8 ); this.addSortType( "NumberKo", this.replace8oa8 ); this.addSortType( "MyDate", null, false, this.sortTimes); this.addSortType( "CellSorterValue", null, false, this.cellSorterValue); this.addSortType( "StringDirFile", this.toUpperCase, false, this.splitDirsAndFiles.bind(this) ); }, /** * How the sorting and the pagination interfere * @param loaderFunc Function Callback called on sorting * @param columnsDefs Array All columns definition * @param crtOrderName String The current column of ordering * @param crtOrderDir String ASC or DESC */ setPaginationBehaviour : function(loaderFunc, columnsDefs, crtOrderName, crtOrderDir){ this.paginationLoaderFunc = loaderFunc; this.columnsDefs = columnsDefs; var found = -1; for(var i=0;i