Help talk:Datatables format

Jump to: navigation, search


Thread titleRepliesLast modified
Sorting and filtering properties of type::date615:48, 10 September 2015
Show entries217:49, 23 June 2015
How to get thumbnails into result datatable?111:06, 10 March 2015
Render wiki links in property fields with type text?116:22, 5 February 2015
Support template?100:45, 2 December 2013
Default sorting211:46, 16 September 2013

Sorting and filtering properties of type::date

The table is not sorted correct if the property that has type::date. Sorting by click on the headline in this case is alphabetical instead of numerical.

Filtering the table does not work for property that has type::date. Filtering ist alphabetical instead of numerical. Example: Filtering for "6 Januar 2015" shows "16 Januar 2015" and "26 Januar 2015" results aditional.

Carchaias (talk)17:41, 20 January 2015

I have the same Problem. Does anyone knows a solution or a workaround?

Thank you in advance


MichaelZ70 (talk)08:51, 16 March 2015

You would have to implement such functionality.

MWJames (talk)13:50, 16 March 2015

And do you know where and how to do it? ;)

Thanks Michael

MichaelZ70 (talk)14:48, 16 March 2015

[0] contains some old/early notes about how sorting can be implemented which certainly needs adaptation but should give a hint as to where to look.


MWJames (talk)17:31, 16 March 2015

I still to find a way to implement sorting for values of datatyp DATE. I looked at your sample but did manage to implement it. Maybe someone else found a solution for this?

MichaelZ70 (talk)11:22, 19 March 2015

I have not fully tested this, but in my data, it seems like fields where each value is set, the dates are sorted properly (I have also found it helpful to set times, as dates seem to be calculated for this format based on the server's time zone, regardless of user settings). If there are any blank values in any of the results, they will not sort properly.

For example, if I have two columns with date values, one of which has a value for each date, and one of which is blank, the column with all values set will sort properly, but the column with some blank values set will sort alphabetically (e.g., 1, 12, 2, then alphabetical month).

Filtering will not fix this; the underlying query has to return results with values set for each result in the relevant column for chronological sorting to work.

Amhendler (talk)15:48, 10 September 2015

Show entries

Is it possible to change the default number of entries on a page from 10 to another number? Thanks

Qiubov (talk)15:29, 19 May 2014

I would need that, too! Should be configurable by an extra parameter.

Krabina Bernhard (talk)12:31, 10 June 2015

Please have a look at [0] which is currently not implemented but we welcome pull requests.


MWJames (talk)17:49, 23 June 2015

How to get thumbnails into result datatable?

I am runing a german Wiki and so far I wasn't able to get thumbnails into the result datatable.

My query looks like this:

{{#ask: [[Kategorie:Archivalien]] | mainlabel=Titel | ?Bild | ?Signatur | ?Archivierungsart | ?Laufzeit | ?Quelle | ?Aufbewahrung der Originale | format=datatables | link=all | headers=show }}

All result data from the semantic attributes "Signatur", "Archivierungsart", "Laufzeit", "Quelle" and "Aufbewahrung der Originale" are listed correctly in the datatable. However, the attribute "Bild" contains the file name of a related picture (e.g. "hvg28.jpg") and I would like to have a thumbnail of that picture in the corresponding column of the result datatable. This is what does not work. What am I doing wrong? What are the requirements to get thumbnails into the result datatable?

Many thanks for any help!

Sochin67 (talk)00:02, 18 July 2014

I am not sure it help after 6 months, but I may have a solution. In my wiki every page which has image has the property [[Has image::Image.jpg]] and when I just asked in the query ?Has image=Bild it shows the picture without any other hacking.

Grerika (talk)11:05, 10 March 2015

Render wiki links in property fields with type text?

I see under the Limitations section that "Common wiki markup, such as that for italic or bold, is often not rendered by the datatables format." Does this include basic wiki links? I have a property of type Text and some of the values include basic wiki links. Those are not being rendered, but instead display all the double brackets. Is there a way to render these as wiki links?

Darenwelsh (talk)16:06, 5 February 2015

> as that for italic or bold, is often not rendered by the datatables format." Does this include basic wiki links?

The datatables format is to facilitate the query-API, which means any extra parsing has to be implemented on top if it. I can't remember but I think the JSON output does not render HTML and instead uses the wikitext source to be deployed to a client which means you have to render those links after it has been received by the client (in JS).

I personally don't have time to look at those things but anyone is welcome to send patches to the SRF repo to be reviewed.

MWJames (talk)16:21, 5 February 2015

Support template?

Does the datatables format support templates? I love the features of the new format, but need to change the way it's displayed and how data is linked, like can be done with the listwidget format.

D3mon187 (talk)20:12, 30 November 2013

Feel free to add such feature, personally I have not planned to extend the current functionality.

If you do extend the format, please be aware that this format communicates solely through the SMW Api which means that any additional parsing/formatting has to use the MW Api [1].


MWJames (talk)00:45, 2 December 2013

Default sorting

Hi, is there any way to achieve a default sorting of the tables (according so SMW "sort" parameter)?

Kaboomki (talk)16:17, 22 August 2013

No that's not possible right now because the QueryApi doesn't serialize [1] the information necessary so that DataTables could act upon.


MWJames (talk)16:31, 22 August 2013

Thanks! And is it possible to rise the default limit for entries that are queried in the background? Just changing "$smwgQDefaultLimit" or rising the limit in the #ask query didn't help. Its not very comfortable for usere if they have to manually change the limit parameter in the interface to access a more comprehensive amount of content.


Kaboomki (talk)11:46, 16 September 2013