Page 1 of 1

Create sortable table rows in webhelp

Posted: Tue Sep 20, 2016 11:05 pm
by akmenting
I can only find tutorials in Oxygen for sorting rows in the Author. How can I create sorting in webhelp output so that the user can click a column head and sort the row entries in ascending or descending order?

Re: Create sortable table rows in webhelp

Posted: Thu Sep 22, 2016 5:45 pm
by alin
Hello,

You can have a look at http://tablesorter.com/. This is a jQuery plugin that you can include in you WebHelp output in order to have sortable tables.

In order to refer a custom JavaScript file in the WebHelp Responsive output HTML files please follow these steps:
  1. Include the script declaration into an well-formed XML file. For example the content of the XML file should look like:

    Code: Select all

    <script type="text/javascript" src="${oxygen-webhelp-output-dir}/my-script.js"/>

    Note: Note that the example above uses the ${oxygen-webhelp-output-dir} macro in order specify the path of the referenced JavaScript file relative to the output directory.
    Note: If you want to reference multiple JavaScript files, place the <script> elements within a <div> element. For example:

    Code: Select all

    <div>
      <script type="text/javascript" src="http://www.example.com/my-script1.js"/>
      <script type="text/javascript" src="${oxygen-webhelp-output-dir}/my-script2.js"/>
    </div>
  2. Edit the WebHelp Responsive transformation scenario and set the value for the webhelp.fragment.head parameter to the absolute path of the XML file at step 1.
    Note: If you want to insert the JavaScript reference in another location within the HTML page you can find the complete list of available parameters here: https://www.oxygenxml.com/doc/versions/ ... ders_usage

In order to copy JavaScript resources to the output directory follow these steps:
  1. Place all your JavaScript resources in the same directory.
  2. Edit the WebHelp Responsive transformation scenario and set the value for the webhelp.custom.resources parameter to the absolute path of the directory at step 1.
    Note: All files from this directory will be copied to the root of the WebHelp output.

Regards,
Alin

Re: Create sortable table rows in webhelp

Posted: Wed Sep 28, 2016 6:26 pm
by akmenting
Thank you!