This project has moved. For the latest updates, please go here.

How to pass items per page as per user selection

May 17, 2011 at 8:45 AM


Current system have shown records of page size 20. which is hard coded in "ListViewSetting.cs" as "private int _itemsPerPage = 20" and in "ListViewSettingsCollection.cs" passing items parameter as 20.

so if user selected 100 records it shows correct output. but when user click on status dropdown then all records filtered with status selection and again page size become by default 20. it not retain at 100 or any thing which is selected by user previously. how i achieve this functionality.

Thank you,

May 17, 2011 at 9:47 PM

This is in one of the TicketDesk 1 releases obviously (TicketDesk 2 uses different names, though the mechanism is similar overall).

The page size is not hard-coded; those are just the default values. In ListViewSetting.cs there is a default value of 20 on the private field in case a more specific value isn't supplied in the constructor call. The part of ListViewSettingsCollection.cs that you pointed out is just the part that creates the initiallists and settings for a user who doesn't not already have those settings stored in their profile (new users). Again, that's just a default value. 

I can confirm that there is a bug in how the ticket history handles changes to the filter columns and page size; but it doesn't appear related to the default page sizes, I can produce results where the system applies a previously selected page size, but which previous page size gets misapplied is not necessarily 20.

I will try to track down where the problem is, but the two locations you've cited are not likely to be related to the problem.

May 17, 2011 at 11:19 PM

BTW: The correct behavior is for the system to remember the page size (and the filter and sorts too) on a per user AND per list basis.

The settings should persist between different sessions, as well from one browser/computer to another.