[Half-Solved] "chosen" Functionality of select-lists in filter also?

mudshark79

Member
Hello!

I'm curious if there are plans to implement the Chosen-Functionality of Select-List Element such as DB-Join Dropdowns or CCDs in the List-Filter area also?

Am I missing something?

Thanks and Regards,

Matthias
 
Last edited:
Aside from the fact I'm still interested and maybe missed something - I found another way to solve my specific problem that I Wanted to share:

I have a DB-Join "my_element_id" which is setup as the Watch-Element for two other DB-Joins. This works great and one also has the CDD-functionality in the list filters.

The CDD-Functionality breaks, if I change the List-Filter to Autocomplete . Setup as a dropdown the filter Is way too unhandy.

Solution: I created a second DB-Join "my_element_id_autocomplete" which holds a copy of the Value (copied via form-plugin or whatever). It's hidden in the form but the list Filter is Setup to Autocomplete.

now add list.js:
(Please remove comments):


JavaScript:
//This is the ID of the select in the Filter-Box:
var my_element_id_dropdown = jQuery( '#mylist___my_element_idvalue' );


requirejs(['fab/fabrik'], function () {
    /* Yes, someone knew i would once look for it in */    
/* media/com_fabrik/js/autocomplete-bootstrap.js on line 227: */
    Fabrik.addEvent('fabrik.autocomplete.selected', function(autocomplete_element, autocomplete_value){
    var new_selection = '<option value="'+ autocomplete_value + '" selected="selected">Temporary</option>';
    klienten_id_dropdown.append( new_selection );
    klienten_id_dropdown.val(autocomplete_value);
   /*heads up, this is not jQuery but 'pure' JS because the Event also was Setup as so in */
/*plugins/fabrik_element/cascadingdropdown/filter.js */
   document.querySelector("#mylist___my_element_idvalue").fireEvent("change");

  });

});

Hope someone may can use this - surpised how few lines make this possible.

Regards,

Matthias
 
Last edited:
To answer your question, yes, we intend to gradually implement 'chosen' features for everything. It's just one of those work in progress things, which I'll work on as I get time.

One of the main issues I need to work on atm is propagating the jQuery events that chosen triggers through to our Moo events. At the moment, having the observed element of a CDD be a chosen dropdown doesn't work, because the CDD hangs a Moo event listener for the 'change' event on the watched dropdown ... which never gets fired if that dropdown has been chosen-ified. Solvable, I just haven't had time to look at it.

-- hugh
 
Thanks for the Update. Is it already in github? I made a quick test and can't confirm. Chozen-Select doesn't play nice with a CDD in the form and no Chozen in the list filter's view

And risking being a pain ;): I was not not talking about Dropdowns and CDDs in Forms (there I'm quite happy with what I got), I was mainly talking about the filters view.

So wishlist would be:
- bring chozen to filter-views
- make CDDs work in filter's view with chozen or autofill as a watched object...

Take your time, won't start a next project soon, anyway :).

Regards and Thanks,

Matthias
 
Last edited:
Yes, I know you were talking about filters. I wasn't. It was just an FYI.


Sent from my HTC One using Tapatalk
 
We are in need of some funding.
More details.

Thank you.
Back
Top