tags:

views:

541

answers:

3

hi,

I'm using Views dropdown filter (with tags) and it works great. However I would like to customize it in this way:

1 - remove button "Apply" and automatically update Views (at the moment I'm updating it with Ajax)

2- allow my customer to change the order of the dropdown items (specifying top items)

3- select multiple items without having to press the SHIFT button on keyboard (do not unselect other items if new items are selected)

http://dl.dropbox.com/u/72686/viewsFilter1.png

Let's suppose the items in the image are tags... something like this: http://dl.dropbox.com/u/72686/viewsFilter2.png

thanks

A: 
  1. Use jQuery to .hide() the Apply button, and then set a handler on the filter fields so that whenever one of them is changed (i.e., by the user), the Apply button registers a click.
  2. Hmm, can't help with this one. You might be stuck writing a custom module that hooks into the Views API.
  3. Sounds like the Sexy Exposed module would solve this problem?
Mike Crittenden
hi thanks for answers, I saw the Sexy exposed module. Do you think that with some CSS I can hide the check box and transform it in something like this: http://dl.dropbox.com/u/72686/viewsFilter2.png ?
Patrick
CSS isn't going to be able to do that. You'll probably have to use one of the many jQuery plugins that allow you to use custom styles on form elements.
Mike Crittenden
A: 

hi,

I'm using the following code to keep the items selected and it works.

$('#edit-tid option').click(function() {

$(this).toggleClass("selected");    
$("option:not(.selected)").removeAttr("selected"); 
$("option.selected").attr("selected", "selected");

    //submit request
 $('#edit-submit-Portfolio').click();

});

When a request is submitted the page is refreshed. The selected items are still selected (class="selected") but the javascript code do not keep them selected.. I don't understand why, since they have the correct class attribute.

So.. it doesn't work after refresh, even if the html code is the same (the same class="selected" attribute is assigned to the same items).

thanks

Patrick
A: 

I've solved point 1 and 2, installing better exposed filter module from drupal website.

Patrick

related questions