Hi,
i have several questions about the TablePager-Class:
* is it possible to change the styling of the tables? * * The default-style is blue (http://commons.wikimedia.org/wiki/File:Tablepager.PNG) * * all other Tables are grey (http://commons.wikimedia.org/wiki/File:Version.PNG)
* is it possible to change the sort-order in a sortable tablepager-table? * * with "function getDefaultSort()" I can only sort in ascending order
* is there some more documentation than: http://svn.wikimedia.org/doc/classTablePager.html ?
LB
On 26/01/13 12:21, Lukas Benedix wrote:
Hi,
i have several questions about the TablePager-Class:
- is it possible to change the styling of the tables?
- The default-style is blue
(http://commons.wikimedia.org/wiki/File:Tablepager.PNG)
- all other Tables are grey
Yeah, I see an interesting stylesheet comment there:
/** * Data table style * * Transparent table with suddle borders * and blue row-highlighting. */
It should be overridable with getTableClass(), but someone who can't spell "subtle" has hacked it up so that you can't, adding a hard-coded mw-datatable class.
Submit a core patch to gerrit to move the mw-datatable class to getTableClass(), like
function getTableClass() { return 'mw-datatable TablePager'; }
And remove the hard-coding from getStartBody(). Then you will be able to change the class, and use descendant selectors to style any part of the table.
- is it possible to change the sort-order in a sortable tablepager-table?
- with "function getDefaultSort()" I can only sort in ascending order
You can use:
class MyTablePager extends TablePager { function __construct( IContextSource $context = null ) { parent::__construct( $context ); $this->mDefaultDirection = true; } }
- is there some more documentation than:
No.
-- Tim Starling
wikitech-l@lists.wikimedia.org