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

This is what you call a component builder. I was able to master using this in a very short time and the resulting component works like a charm. Not just a basic component builder but a fully working component builder with forms fields tables all ready to go. You can make the list and item views to display in the front and back end. Also there is a great forum just starting to evolve and I'm sure this will grow very rapidly when you all realise how good this tool is.
Kevin (JED)

         

Get Started