If a select had an Ajax function, this don't work.
Any idea?
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | dropkick-ajax-1342002-4.patch | 983 bytes | stevetweeddale |
If a select had an Ajax function, this don't work.
Any idea?
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | dropkick-ajax-1342002-4.patch | 983 bytes | stevetweeddale |
Comments
Comment #1
mistergroove commentedSome how we need to bind the onchange events on the select to dropkicks change event...
$('.change').dropkick({
change: function (value, label) {
// fire select onchange event
}
});
This would be amazing if this could be done in the dropkick jquery library - so it automatically takes the selects events and binds them onto the dk dropdown....
I wish I was better at jquery event handling...
Comment #2
vivekguptakota commentedI am facing same problem.So please let me know any ideas.
It is very urgent form me.
Comment #3
calebtr commentedI got around this by skipping this module, leaving the library installed and adding everything manually.
In a custom module, I added:
Then to trigger some event for a select with id='myselect':
Comment #4
stevetweeddale commentedHere's a patch!
It just sets the 'custom change callback' to fire the change event on the original select element. To be honest, I don't know why dropkick doesn't just do this by default. With jQuery around, binding to a select element's change event is just as easy as providing the plugin with 'custom change callback'.
Comment #5
mossill commentedstill having issues on the second time i click a drop down menu...
The first time works correctly, the .change() executes but for some reason the ajax form is not submitted the second time.
Comment #6
mossill commentedHere is a quick and dirty fix to the patch you posted. I altered the Dropkick.js file in the modules folder. I had to pull the class name from the object to get it to work correctly on the select element after the behavior change.
////////////////////////////////////////////////////////////////////
(function($) {
Drupal.behaviors.dropkick = {
attach: function(context) {
$(Drupal.settings.dropkick.selector, context)
.not('#field-ui-field-overview-form select, #field-ui-display-overview-form select') //disable dropkick on field ui
.each(function() {
$(this).dropkick({
change: function (value, label) {
obj = this;
element = obj.context.className;
$('.' + element).val(value).change();
}
});
});
//add clearfix to parent .form-item to fix floats
$('.dk_container').parents('.form-item').addClass('clearfix');
}
}
})(jQuery);
//////////////////////////////////////////////////////////////////// dropkick.js
Comment #7
huijing commentedThis issue is still present in 7.x-2.x
Comment #10
saniyat commentedIssue fixed and committed to dev branch.