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

TOPIC:

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

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

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

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

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

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

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

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

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

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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 following user(s) said Thank You: MorganL

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

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

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

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

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

Les générateurs de code je les connais presque tous pour les avoir essorés en long en large et en travers ... mais celui ci c'est vraiment un outil formidable de simplicité et d'efficacité !
Marc. (liubov - Forum)

Get Started