And could I use there data from MySQL db through sql
plugin? I have looked
for this usage but did not find it.
Yes, as long as you provide your custom results page. You can adapt, for
example, XWiki.AllAttachmentsResults or XWiki.DeletedDocuments.
2010/11/30 Jerome Velociter<jerome(a)xwiki.com>
> Hello tomasg,
>
> If you want to have dynamic sorting and filtering, you should rather
> use the LiveTable component/macro
>
> Checkout :
> *
http://code.xwiki.org/xwiki/bin/view/Macros/LiveTableMacro
> *
http://platform.xwiki.org/xwiki/bin/view/DevGuide/LiveTable
>
> Cheers,
> Jérôme
>
> On Tue, Nov 30, 2010 at 1:17 PM, tomasg<tomas.grunt(a)gmail.com> wrote:
>>
>> Hello, I would like to know whether is possible refresh table data when I
>> change column for sorting.
>> Now, when I click to sort by some column, table is sorted with actual
> table
>> data, not with all data. I expect that is needed to add "order by" to
sql
>> query, but what else should I add?
>> If this is not possible could I use livetable with data from sql query?
>>
>> Thank you
>>
>>
>> Here is my code:
>>
>> $xwiki.ssfx.use("js/xwiki/table/table.css")
>> $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
>>
>> #connectDbTEP($dbc)
>> #countRooms($pocetMistnosti)
>>
>> #set($paginationParameters = {
>> 'totalItems' : $pocetMistnosti,
>> 'defaultItemsPerPage' : 15,
>> 'url' : $doc.getURL('view', $queryParams)
>> })
>> #pagination($paginationParameters)
>>
>> <table id="searchResults" class="grid sortable
doOddEven">
>> <tr class="sortHeader">
>> <th>Místnost</th>
>> <th>Zodpovědná osoba</th>
>> <th class="unsortable">Operace</th>
>> </tr>
>>
>> #foreach($row in $dbc.executeQuery("select id_room, mistnost, prijmeni,
>> jmeno from room, osoby where room.id_os = osoby.id_os limit
>> $paginationParameters.firstItem, $paginationParameters.itemsPerPage"))
>> <tr>
>> <td> $row.getString("mistnost")</td>
>> <td> $row.getString("prijmeni")
$row.getString("jmeno")</td>
>> <td>
>> EditRoom?id_room=$row.getLong(
>> DeleteRoom?id_room=$row.getLong(
>> </td>
>> </tr>
>> #end
>> </table>
>>
>> #set($discard = $paginationParameters.put('position',
'bottom'))
>> #pagination($paginationParameters)