• Online Demo
  • 30-day Free Trial

Go Back   Blesta Forums > Community > General Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2012, 04:07 AM
phatpixel phatpixel is offline
Junior Member
 
Join Date: Jul 2012
Posts: 11
Default Changing default table sort order and results per page

I'm looking to change the default table sort order for Clients (to Company), Packages (to Name), etc. rather than using the ID.

I can see how this is done in the onclick attribute of the table header but was wondering the best way to implement such a change? I could add an onload attribute to the body tag, but for efficiency it would be best to make the initial call to the database pull back the data in the desired order.

Also, as I have a large monitor, what would be the simplest way to alter the number of results returned per page?

Any suggestions? Thanks.
Reply With Quote
  #2  
Old 07-23-2012, 07:50 PM
Paul's Avatar
Paul Paul is offline
Blesta Developer
 
Join Date: Apr 2006
Location: Wherever I go, there I am.
Posts: 1,469
Send a message via AIM to Paul Send a message via MSN to Paul
Default

For the number of pages, see inc/config.php LIST1 define. The default is 20 I believe, but you can increase it here to whatever you like.

http://demo.blesta.com/a-clients.php...pany&order=ASC
http://demo.blesta.com/a-packages.ph...name&order=ASC

You can use DESC for order to sort descending.

Then, just update the template, templates/argentum/a-structure.pdt I believe, and make Browse Clients and Browse Packages link to these URLs respectively (without demo.blesta.com of course)

I hope this helps!
__________________
Paul
Misc Stuff Guy

Blesta
Professional Billing
www.blesta.com
Reply With Quote
  #3  
Old 07-26-2012, 06:37 AM
phatpixel phatpixel is offline
Junior Member
 
Join Date: Jul 2012
Posts: 11
Default

Thanks, that's great.

How can I now change the sort order of the tables within the client centre? I would like invoices to sort by due date (ascending), services by renewal date (ascending), tickets by priority (then by last updated, if possible) and transactions by date (descending).
Reply With Quote
  #4  
Old 07-26-2012, 04:45 PM
Paul's Avatar
Paul Paul is offline
Blesta Developer
 
Join Date: Apr 2006
Location: Wherever I go, there I am.
Posts: 1,469
Send a message via AIM to Paul Send a message via MSN to Paul
Default

Each of these content sections are AJAX, so you might be able to update their references in the right template, but using their direct links will cause them to be loaded by themselves.

http://demo.blesta.com/a-center.php?...ated&order=ASC
http://demo.blesta.com/a-center.php?...rity&order=ASC

Also, services are not sortable in v2.5. (They are in v3)
__________________
Paul
Misc Stuff Guy

Blesta
Professional Billing
www.blesta.com
Reply With Quote
Reply

Bookmarks

Tags
pid, results, sort, table, uid

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 02:51 PM.