Loading...
 
Features / Usability

Features / Usability


Pagination issues with LIST with TABLESORTER?

posts: 24 Australia

Hi All,

I came across something odd today. I am using the following in the list to paginate the data - this tracker has 11 items and I have set the max pagination to 5:

Copy to clipboard
{pagination max="5"}


The list works fine and the pages show up correctly at this point.

BUT, if I have set pagination max="5" and I I have tablesorter used for the list I can't go to any other pages / pagination for items 6 - 11. I can only ever view the first 5 items, I can't even filter anything not within these 5 items.

Copy to clipboard
{tablesorter server="n" sortable="type:reset" tsortcolumns="type:text|type:none|type:none|type:none" tsfilters="type:text|type:dropdown|type:dropdown|type:text" }


The full LIST syntax is here:

Copy to clipboard
{LIST()} {filter field="tracker_id" content="6"} {filter type="trackeritem"} {pagination max="5"} {sort mode="modification_date_ndesc"} {OUTPUT(template="table")} {column label="Name" field="name" mode="raw"} {column label="Status" field="status" mode="raw"} {column label="Department(s)" field="depts" mode="raw"} {column label="Department(s)" field="desc" mode="raw"} {tablesorter server="n" sortable="type:reset" tsortcolumns="type:text|type:none|type:none|type:none" tsfilters="type:text|type:dropdown|type:dropdown|type:text" } {OUTPUT} {FORMAT(name="name")}{display name="tracker_field_POW_Name" format="trackerrender"}{FORMAT} {FORMAT(name="status")}{display name="tracker_field_POW_Status" default=""}{FORMAT} {FORMAT(name="depts")}{display name="tracker_field_POW_Depts" default=""}{FORMAT} {FORMAT(name="desc")}{display name="tracker_field_POW_Desc" default=""}{FORMAT} {ALTERNATE()}{REMARKSBOX(type="warning" title="There are no line items that can be displayed." close="n")}{REMARKSBOX}{ALTERNATE} {LIST}


Do you know what I'm doing wrong? I'm on v21.5 if it helps...

Thanks,

Leena

posts: 24 Australia
Leena wrote:
Do you know what I'm doing wrong?


Also a screenshot of what I mean if it helps...

EDIT: Sorry I tried to upload the screenshot but for whatever reason it failed - I would get you a screenshot of that error but can't...It just says File upload failed: File could not be uploaded.


posts: 24 Australia
Bernard Sfez / Tiki Specialist wrote:

Mmm... I'm not strong with tablesorter and Tiki but I think it has it's own pagination parameters and tools.

Yes, see :
https://doc.tiki.org/Tablesorter
https://doc.tiki.org/PluginFancyTable#Sorting_Filtering_and_Paginating


Thanks Bernard,

I have a sort-of solution that works (in a hacky way) based on what you shared above:

Copy to clipboard
{LIST()} {filter field="tracker_id" content="6"} {filter type="trackeritem"} {pagination max="1000"} {sort mode="modification_date_ndesc"} {OUTPUT(template="table")} {column label="Name" field="name" mode="raw"} {column label="Status" field="status" mode="raw"} {column label="Department(s)" field="depts" mode="raw"} {column label="Description" field="desc" mode="raw"} {tablesorter server="n" sortable="type:reset" tsortcolumns="type:text|type:none|type:none|type:none" tsfilters="type:text|type:dropdown|type:dropdown|type:text" tspaginate="max:25"} {OUTPUT} {FORMAT(name="name")}{display name="tracker_field_POW_Name" format="trackerrender"}{FORMAT} {FORMAT(name="status")}{display name="tracker_field_POW_Status" default=""}{FORMAT} {FORMAT(name="depts")}{display name="tracker_field_POW_Depts" default=""}{FORMAT} {FORMAT(name="desc")}{display name="tracker_field_POW_Desc" default=""}{FORMAT} {ALTERNATE()}{REMARKSBOX(type="warning" title="There are no line items that can be displayed." close="n")}{REMARKSBOX}{ALTERNATE} {LIST}


So

Copy to clipboard
tspaginate="max:25"


works on the table to paginated, but the number of results returned Overall depends on

Copy to clipboard
{pagination max="1000"}


I looked up whether I can make pagination max a dynamic number based on the number of of results returned. I read somewhere that you can use something like $count. So I tried this but it failed. Any idea how I can get this right?

Copy to clipboard
{pagination max="$count"}


Thanks,

Leena

posts: 24 Australia
Bernard Sfez / Tiki Specialist wrote:

What happen if you remove the plugin list pagination and keep only the one form the tablesorter ?

Else I guess it would be workable in a Smarty template or a Smarty pagination bloc.
But this is something I would have to do/test with my own hands. 🥴


It just defaults to the Tiki default pagination (in my case, 25)...I'm unsure how the smarty templates work - are you able to send me a link that would get me started please? :-)

Thanks.