Here is an example to set order by on pagination
http://arafats.info/cakephp-coditions-on-paginate/
Thanks
Arafat
--
-- http://arafats.info/cakephp-coditions-on-paginate/
Thanks
Arafat
On Mon, Sep 24, 2012 at 1:35 AM, lowpass <zijn.digital@gmail.com> wrote:
Use SortableBehavior. Add a new column "order" to the table and sort on that.
https://github.com/sersilva/cakephp-sortable-behavior
On Sat, Sep 22, 2012 at 10:48 AM, sathishbabu R <pan.sathish@gmail.com> wrote:
> Guys,
>
> Any Solution ?.
>
>
> On Sat, Sep 22, 2012 at 7:50 PM, sathishbabu R <pan.sathish@gmail.com>
> wrote:
>>
>> Thanks,
>>
>> But I am not sure, We can do with cakephp pagination itself.
>>
>>
>> On Sat, Sep 22, 2012 at 7:32 PM, Tilen Majerle <tilen.majerle@gmail.com>
>> wrote:
>>>
>>> you need than create your custom pagination process...cake's pagination
>>> system will not help you :)
>>> --
>>> Lep pozdrav, Tilen Majerle
>>> http://majerle.eu
>>>
>>>
>>>
>>> 2012/9/22 sathishbabu R <pan.sathish@gmail.com>
>>>>
>>>> Thanks for great answer,
>>>>
>>>> Customizing array format is not going to complex, But here, I want
>>>> pagination data based on my sorted list and its should be based on paginate
>>>> limit,
>>>>
>>>> eg,
>>>>
>>>> if my paginate limit is 2,
>>>>
>>>> Then it should show at first page
>>>>
>>>> 7,1 based on my array format,
>>>>
>>>> and 2nd page,
>>>>
>>>> 3,2
>>>>
>>>> and 3 rd page
>>>> 5.
>>>>
>>>> like that.
>>>>
>>>>
>>>>
>>>> On Sat, Sep 22, 2012 at 7:15 PM, Tilen Majerle <tilen.majerle@gmail.com>
>>>> wrote:
>>>>>
>>>>> i hope i understand you good, but pagination is created for records
>>>>> from database..for ordering arrays and stuff like that use Set (in new
>>>>> version is Hash) class from cake :)
>>>>>
>>>>> http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html
>>>>> --
>>>>> Lep pozdrav, Tilen Majerle
>>>>> http://majerle.eu
>>>>>
>>>>>
>>>>>
>>>>> 2012/9/22 Steve Babs <pan.sathish@gmail.com>
>>>>>>
>>>>>> I am having array like,
>>>>>>
>>>>>> $mysort_array = array(7,1,3,2,5) .
>>>>>>
>>>>>>
>>>>>> I want pagination data order by above array value ordered.
>>>>>>
>>>>>> ex,
>>>>>>
>>>>>> 'order' => array('Table.id'=> $mysort_array).
>>>>>>
>>>>>> My pagination result should be ordered like below,
>>>>>>
>>>>>> Table.id => 7,
>>>>>> Table.id => 1,
>>>>>> Table.id => 3,
>>>>>> Table.id => 2,
>>>>>> Table.id => 5,
>>>>>>
>>>>>>
>>>>>> Order By Field only works in find query. Not in pagination, Please
>>>>>> guys help me to come out from this problem.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Like Us on FacekBook https://www.facebook.com/CakePHP
>>>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>>>
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "CakePHP" group.
>>>>>> To post to this group, send email to cake-php@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to
>>>>>> cake-php+unsubscribe@googlegroups.com.
>>>>>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Like Us on FacekBook https://www.facebook.com/CakePHP
>>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>>
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "CakePHP" group.
>>>>> To post to this group, send email to cake-php@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> cake-php+unsubscribe@googlegroups.com.
>>>>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>>
>>>> R. Sathishbabu
>>>>
>>>>
>>>> --
>>>> Like Us on FacekBook https://www.facebook.com/CakePHP
>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "CakePHP" group.
>>>> To post to this group, send email to cake-php@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> cake-php+unsubscribe@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> Like Us on FacekBook https://www.facebook.com/CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscribe@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>>
>>>
>>
>>
>>
>>
>> --
>> Regards,
>>
>> R. Sathishbabu
>>
>
>
>
> --
> Regards,
>
> R. Sathishbabu
>
> --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
--
Thanks & Regards.
-----------------------------------------------------------------------------------------------------------------------------
Yasir Arafat (Hasib)
-----------------------------------------------------------------------------------------------------------------------------
Yasir Arafat (Hasib)
Deputy Project Manager, Software Solutions
Grameen Solutions
Contact Information:
Grameen Solutions
Contact Information:
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
No comments:
Post a Comment