Active
Project:
Jquery Dropdown
Version:
6.x-1.2
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Apr 2011 at 23:05 UTC
Updated:
26 Aug 2011 at 23:33 UTC
Hey there,
Cool module.
One thing... I have it working with an exposed filter for a view, and because you start your script with:
$(document).ready(function() {
//this does the actual css/html replacement of the select dropdown
$("select.jquery_dropdown").each(function(){
$(this).load_jquery_dropdown();//load jquery dropdowns
});
});
The ajax-loaded form comes back invisible!
To fix:
Drupal.behaviors.jquery_dropdown = function(context){
//this does the actual css/html replacement of the select dropdown
$("select.jquery_dropdown:not('.behaviors-processed')").each(function(){
$(this).load_jquery_dropdown();//load jquery dropdowns
}).addClass('behaviors-processed');
};
see here: http://drupal.org/node/304258
Comments
Comment #1
tmsimont commentedSame story in the jquery_dropdown_jump menu:
ALSO -- notice that I changed the action to .submit() instead of .click() -- For some reason .click() doesn't behave as expected when trying to submit an ajax form (e.g. the views filter when "use ajax" is selected)
EDIT --
I tried putting the class onto the <a> but that messes with the fact that you put the reference to the select in the classsname!
So I put the behaviors processed on the <ul>
Thanks!
Comment #2
gregory claeyssens commentedHi, this is nice, I'm having just those ajax problems.
I'm a newbie in this stuff, could you explain how I make sure these new functions get called?
I had made a theme.js (with the original module) with:
Drupal.behaviors.themeAttachJQDropDown = function(context) {
$('.view-filters select').each(function () {
$(this).addClass('jquery_dropdown jquery_dropdown_jump');
});
}
This made the function called on every page refresh but not when using the pager for my view (wich is ajax), but this does not work anymore. I got to be honnest, that code, I did not write it myself, and I barely understand it...
Anyway, Thank you in advance
EDIT: if you want to look at the problem i have: www.yu-card.be/yu/nl (this is before putting in your code, check the view at the bottom, after replacing with your functions the dropdownlists don't get made... :s)
Comment #3
gregory claeyssens commentedNever mind, i fixed it... It had to do with the classes, rookie mistake but hey, i learned something! thanks for the great code
Comment #4
Toxid commentedI tried to do this with an exposed view as well, but did not succeed. I added the class jquery_dropdown with a theme-javascript, perhaps it comes in too late then? How did you manage to add the class to the dropdown?
Comment #5
tmsimont commentedthe key is swapping
with
and adjusting the close of the script, too --
see here: http://drupal.org/node/304258