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

TOPIC:

ordering of combo 07 Nov 2013 15:21 #11547

  • ewajoom
  • ewajoom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 2
Hi,

Is it possible to order combo lists a I want ? (it seems to be ordered by name, for one combo I want it ordered by ordering value)
? (I think it could be a good improvement to have an "order by" properties in builder)

thanks!

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

ordering of combo 11 Nov 2013 19:56 #11573

  • ewajoom
  • ewajoom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 2
More precisions : I would like to have only activ tems (where table.activ=1), and the list orderer by my own order ( order by ordering)...
Anybody knows where is the sql request for combos lists ?

Thanks...

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

ordering of combo 12 Nov 2013 11:44 #11575

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
In brief :

Solution A : Use the context state var.
In prepareQuery(), create a new context case, and call this context for your lists.

Lists are prepared in the view, so
1. find the model which prepare thoses items.
2. Just before getItems(), add
$model->setState('context', 'myContext');
3. Add your custom query in prepareQuery().
in the switch(), add a new case. Call it as your please.



Solution B :
Instance a regular filter directly in the view.

1. find the model which prepare thoses items. (same)
2. Just before getItems(), add
$model->setState('filter.ordering', 'a.activ = 1');

This is possible because ordering is already a possible filter.
If you want a special behaviour, so the use the solution A : Custom SQL Query.

In both cases A & B, the security ACL is always handled per default if you code it correctly.
Coding is now a piece of cake
The following user(s) said Thank You: ewajoom

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

ordering of combo 15 Nov 2013 05:59 #11613

  • ewajoom
  • ewajoom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 2
Thanks for your clear explanations.
I think that it could be a good improvement in the builder.

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

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

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started