Hello,
i always used the jcarousel.js manually, theming my views to make it suitable for the script...
This time i'm trying to use this module and i was so happy initially, it worked out of the box :-)
But i needed to add an exposed filter to the view and i realized this was not working with this module.
I didn't have time to look inside the module to see what it actually does, but i see no exposed filter code in the html, it seems that the exposed filter is acting simply as a filter set.
Am i missing something or simply this module doesn't support exposed filters in views?
Thanks,
Da.

Comments

planctus’s picture

Status: Active » Closed (fixed)

I'm very sorry...this was a silly issue,
it wasn't about the "carousel" view display but more about the general views way of managing exposed filter.
It is possible that simply enabling "ajax" in the views settings would have worked..in the meanwhile i rolled back to a direct use of the js, without this module so i can't say if this is an issue anymore.
I'm closing it, feel free to reopen it if it pointed unwittingly in the right direction :-)
See you,
Da.

Equinger’s picture

Version: 6.x-1.1 » 6.x-2.x-dev
Status: Closed (fixed) » Active

I'm not sure this is a "silly issue" or at least it's silly for me now as well and can't find a solution for this.

I'm using jCarousel in views 3. My guess is that jCarousel should look for the value of the exposed filter and add the selected value to the array of arguments passed by ajax and this isn't happening yet. I need to work on this now, but my solution will be specific to a couple use cases cause I don't have a lot of time unfortunately.

If anyone has any advice in implementing this change, please let me know.

Eric

Equinger’s picture

Below is my ghetto solution to this problem. This thinking is useful, but obviously a real solution would need to be far more generic, but this is what I had time to throw together. Hopefully this is useful for someone.

Adding to jcarousel.js in Drupal.jcarousel.ajaxLoadCallback right after $.extend(viewData, settings). I added the following for one of my filters:

        var filterName= null;
        var filterValue= null;
        $view.find("div.form-item.processed").each( function() {

            filterName= $(this).find("select").attr("name");
            $(this).find("select option").each( function() {
                if($(this).attr("selected")) {
                    filterValue = $(this).attr("value");
                }
            });
        });
        if(filterName =='buttons_for_types') {
            filter = {'buttons_for_types' : filterValue};

            $.extend(viewData,filter);
        }

This fixes MY issue. But again, you will have to make the filter object specific to your field. It also is just grabbing one item from the select list. If there are multiple, I am not yet taking care of this.

Also, if the filter is in its own block and not within the view, this is not useful. The best way would be to search for the dom-id.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after lack of updates.