JCI and TableSorter

Your task:
Display JSON data in the browser in a table that the user can sort. Solution:
Install JCI-Plugin and the plugin “Table Sorter

Original JSON:

Locally stored:

Create a new JCI-Template:

  • URL:
  • Method: PHP-RAWGET
  • twig-template:
<table id="myTable" class="tablesorter">
<th>no (sortable)</th>
<th class="sortless">x</th>
<th>x (sortable)</th>
<th>y (sortable)</th>
<th>randomno (sortable)</th>
{%for v in values %}
{% if loop.index<10 %}
<tr><td>{{loop.index}}</td><td>{{v.x}}</td><td>{{v.x}}</td><td>{{v.y}}</td><td>{{ random(5000) }}  </td></tr>
{% endif %}
{% endfor %}

In action:

Was this article helpful?
0.5 out Of 5 Stars

1 rating

5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 100%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
On this page: