Welcome, Guest
Username: Password: Remember me

TOPIC: List Filters - default fill

List Filters - default fill 30 Nov 2016 22:52 #14782

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
Is it possible to fire a script that will automaitcally pre-fill the list with ALL available options

I am using the AND logic, and I have items that are available in some regions of the world, and some which are in ALL regions of the world.

I would like it some that if someone ticked 'Globally Availalbe' then the LISt would automatically prefill ALL the regions in the n:n relationship and do a search for all items that are in every region there is
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

List Filters - default fill 30 Nov 2016 23:45 #14784

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
Coded a nicer fix

My filter is called filter_regions (that is its ID)

I created a button set like this
<button class="chosen-toggle select" id="globalCheck">Globally Available?</button>
<button class="chosen-toggle deselect">Deselect all</button>

then added this script at the end of the view
<script>
    $('.chosen-toggle').click(function(){
        $('#filter_regions option').prop('selected', $(this).hasClass('select')).parent().trigger('liszt:updated');
    });
</script>

We now have a button that selects all options / and one that clears them
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

List Filters - default fill 30 Nov 2016 23:47 #14785

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
The above snippet would probably be quite easy to include in the builder as a nice extra I suspect, who doesn't want a select all / deselect option :-)
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

List Filters - default fill 30 Nov 2016 23:54 #14786

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Yes, let me some time...
I was thinking also to create an optional radio button (AND / OR / NOT) which acts like a filter to send the logic state var.

All this is improvable, I did that feature very fast as a draft for the moment.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: MorganL

List Filters - default fill 01 Dec 2016 00:07 #14787

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
Dont think me ungrateful, the timing of this filter is incredible, and it works superbly (except for NOT which I raised a ticket on) and already implemented on my dev site
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.
Time to create page: 0.070 seconds

Get Started