Table cannot be sorted by a specific field when using xslt tag

Hi Everyone,

We'are using Sharepoint 2013 to develop a online report. There is a field named "Created date" which stores the date time information(eg. 2015-7-20 1:30PM). In order to sort the whole data by "Created date", the following script is used:

<xsl:for-each select="/dsQueryResponse/ChangeRequestList/Rows/Row">

<xsl:sort select="@Created" order="descending"/>

<xsl:call-template name="dvt_L0Approve.rowview" />

</xsl:for-each>


@Created stands for the field "Created date". But it doesn't work, the table is not sorted at all. Can anyone give some advice on this? Thanks a lot.

regards,

Oliver

July 29th, 2015 2:18am

Hi Oliver,

About how to sort date time field using XSL, the article below would be helpful:

Sorting dates in XSL

http://www.codeproject.com/Articles/4261/Sorting-dates-in-XSL

As an alternative, you can also create this table using custom JavaScript, it will be more flexible to implement the logic of date time soring.

Here are some JavaScript table plugins for your reference:

http://www.sitepoint.com/30-amazing-jquery-tables/

Thanks
Free Windows Admin Tool Kit Click here and download it now
July 30th, 2015 3:10am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics