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.057 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started