Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

All element list count 16 Apr 2013 08:16 #7049

Hello,
in the begining i would like to say that j-cook is absolutly fantastic tool! And the person who crate it is genius.
I have created few components, and modify them for my purpose.
The problem that i have encountered is ridicul:
I have no idea how to show count of all items in the frontend collection view.

For exemple: I have 7 elements to show. I set paggination to show on every page 5 elements. So i get the view with 5 elements and paginnation to next page with 2 elements.
I need to show count of all found items (including filters, and search boxes).

I was thinking that model will contains all elements, but view get only elements that are going to be shown (in ex. 5 - not 7).

My main problem is that i do not understand where is the pleace that the selected items are cuted by the pagination.
Where can i get access to query and execute it (i mean the query created in prepareQuery)?
Or is there a posibility to get all items in view.html.php?

Is there an easy way of geting count of all elements matching query?

I do not care if I get access to this "magic" value by $this-> or $items-> or set this value to all items->itemsCount

Please help, or at least give me a clue where should i look in code.
B)

Please Log in or Create an account to join the conversation.

Re: All element list count - Resolved 08 May 2013 10:19 #7153

I have been trying to do smth for few hours.
Then I decide to get back to other projects (more like .net). And today i found it easly!
So the answer is: $this->pagination->total
The following user(s) said Thank You: VeCrea

Please Log in or Create an account to join the conversation.

Re: All element list count - Resolved 08 Jul 2013 09:56 #7909

In which file did you change to "total" ? I have the same problem.

Please Log in or Create an account to join the conversation.

Re: All element list count - Resolved 09 Jul 2013 09:52 #7926

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
You can create a special SQL in prepareQuery() of the model.
You can sum in PHP in you view.html.php
You can sum dynamic is JS in the template file.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.058 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started