Re: CakePHP 2.6.X Pagination Sort Errors

2015-03-21 Thread David Cole
As luck would have it, after completing more section it started functioning properly. Very strange that an error like this would simply disappear... I have noticed that by using the sort function that it does not maintain pretty url's. It's uses /admin/pages?sort=Page.idorder=asc -- Like Us

CakePHP 2.6.X Pagination Sort Errors

2015-03-21 Thread David Cole
I am faced a new issues regarding CakePHP 2.6.X and pagination; I've never had this issue before and it only happens when attempting to use $this-Paginator-sort(...) in a view. $this-Paginator-sort('Page.id', 'ID', array('model' = 'Page')); $this-Paginator-sort('Page.id', 'ID');

Pagination Sort, Resetting Data

2014-02-27 Thread Eric Chan
Hello, I just starting baking with CakePHP and I'm slowly grasping the basics. So far I've created a view to display all the data in table format from a table in the database with pagination. There is a column in the table that contains browser information (Firefox, Chrome, Safari...etc). So

Re: Pagination Sort, Resetting Data

2014-02-27 Thread tfirvin
你是用 Paginator-sort() 產生的連結(我知道這裡你把它變成checkbox了),再點擊它的時候,已經不是 post request; 但取而代之是傳入 querystring 或是 named parameters,這時候你的 searchByBrowser 應該要在接收到這些與sort有關的參數時, 最後要再指定給 $this-request-data,這樣 view 在被 rendering 的時候就會把 request data 的值填回你的 Form 表單。 Eric Chan eric.hf.c...@gmail.com 於 2014/2/27

Pagination-sort associated Model

2013-05-06 Thread Levavasseur Jacques
Hello, I use cakephp 2.3.4 When I use paginator-sort on a field of model default I have no problem. But if I want to sort on a field associated, sorting is the default. I use the code: $this-Paginator-sort(Model.NOM','HeaderName') when I look at $ this- params is what I get, you can see it at the

Re: Pagination: Sort by count of related model (e.g. User - Posts)

2010-06-15 Thread dtemes
Depending on how precise your information should be you can add a number_of_posts field to your users table and update the count periodically, you can also keep the field updated with database triggers, or create an action to run the update query from cakephp admin pages on demand. That's just

Pagination: Sort by count of related model (e.g. User - Posts)

2010-06-13 Thread DigitalDude
Hey, I have a problem here and need to fix it. It's about the following situation: I have a model User that has a relation to some entrie, let's say Posts. I want to paginate the User-Model and add a counting of the user's posts to my index of Users. So I will have the following table- structure

Re: Pagination: Sort by count of related model (e.g. User - Posts)

2010-06-13 Thread calvin
Ideally, you should be able to create post_count as a virtualField and then sort by that, by as the cookbook states, the paginator can't order by virtualFields of associated models, so you wouldn't be able to sort by it. But there are two simple workarounds for this:

Re: Pagination: Sort by count of related model (e.g. User - Posts)

2010-06-13 Thread John Andersen
Would using the belongsTo models counterCache not be a better solution, so that it will not be necessary to perform the counting every time the users are listed with the post count? Mentioned in the CakePHP book at: http://book.cakephp.org/view/1042/belongsTo Enjoy, John On Jun 13, 3:42 pm,

Pagination Sort

2010-05-04 Thread sijo jose
Hi guys, I have this model Structure - Model 1 - Union var $belongsTo = array( 'Address' = array( 'className' = 'Address', 'foreignKey' = 'address_id', 'conditions' = '', 'fields' = '', 'order' = '' ) ); Model 2 - Address var $belongsTo = array( 'District' = array( 'className' = 'District',

Re: Pagination Sort

2010-05-04 Thread Andrei Mita
I believe paginate documentation in the book has a similar example. On Tue, May 4, 2010 at 9:48 AM, sijo jose jose.s...@gmail.com wrote: Hi guys, I have this model Structure - Model 1 - Union var $belongsTo = array( 'Address' = array( 'className' = 'Address', 'foreignKey' =

Re: Pagination Sort

2010-05-04 Thread Andrei Mita
Check out the 2 links below: http://book.cakephp.org/view/164/Pagination http://book.cakephp.org/view/858/Using-Containable-with-pagination On Tue, May 4, 2010 at 11:07 AM, Andrei Mita andrei.m...@gmail.com wrote: I believe paginate documentation in the book has a similar example. On Tue,

Re: Pagination Sort

2010-05-04 Thread sijo jose
Well thanks for the prompt reply I have this model Structure - Model 1 - Union var $belongsTo = array( 'Address' = array( 'className' = 'Address', 'foreignKey' = 'address_id', 'conditions' = '', 'fields' = '', 'order' = '' ) ); Model 2 - Address var $belongsTo = array( 'District' =

Pagination sort() tweaks

2007-09-02 Thread Dave
I was curious if anyone would like to comment on these few changes I've made to the pagination helper. I've noticed that regardless everything is always sorted asc, which for me didn't work as I need to be able to sort asc or desc from links next to the field names. (EG: Name (Asc) | (Desc)) So