Welcome, Guest
Username: Password: Remember me

TOPIC: 'Selected' value in filter combobox

'Selected' value in filter combobox 13 Nov 2011 14:18 #486

  • twev
  • twev's Avatar
  • Offline
  • Senior Member
  • Posts: 62
  • Thank you received: 15
  • Karma: 6
My database contains several thousand entries and I have several filters which break the table into much smaller selections. When I show the initial collection it often times out as it tries to show every line. I would like to set the 'Selected' value on the filter combo to the first item in the list and prevent the default null value from being selected.

Is there an option to do this? (in the class for the combobox perhaps, I looked but couldn't find it)
The administrator has disabled public write access.

Re: 'Selected' value in filter combobox 14 Nov 2011 10:25 #489

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
There are no options for this.

You have to do it by yourself.
In the controller, or in the model.

You can also define the menu link for this page with an url suffix :

&filter_myfield=my_value
Coding is now a piece of cake
The administrator has disabled public write access.

Re: 'Selected' value in filter combobox 14 Nov 2011 11:04 #492

  • twev
  • twev's Avatar
  • Offline
  • Senior Member
  • Posts: 62
  • Thank you received: 15
  • Karma: 6
Thanks for that, I will give it a try.
The administrator has disabled public write access.

Re: 'Selected' value in filter combobox 14 Nov 2011 20:52 #501

  • twev
  • twev's Avatar
  • Offline
  • Senior Member
  • Posts: 62
  • Thank you received: 15
  • Karma: 6
The URL filter worked a treat, thanks.
admin wrote:
There are no options for this.

You have to do it by yourself.
In the controller, or in the model.

You can also define the menu link for this page with an url suffix :

&filter_myfield=my_value
The administrator has disabled public write access.

Re: 'Selected' value in filter combobox 17 Nov 2011 12:24 #528

  • twev
  • twev's Avatar
  • Offline
  • Senior Member
  • Posts: 62
  • Thank you received: 15
  • Karma: 6
A suggestion for the future - If the 'Null value label' for the combo box in a filter is set to 0 (zero) then fill the combo box with values but remove the show all value at the top of the list. Or better still have a check box to to do this perhaps.
Without this I think people will wonder why their component no longer works when their database grows. Mine has 4,500 records and without the filter I just get a blank screen.
Thanks
Trevor
The administrator has disabled public write access.
Time to create page: 0.059 seconds

Get Started