Skip to content

Commit

Permalink
Fix #30: Better validation for undefined groups key param
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Oct 26, 2015
1 parent 03b086d commit 89f93a0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
41 changes: 25 additions & 16 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
version 1.4.3
=============
Change Log: `dependent-dropdown`
================================

## Version 1.4.4

**Date:** 26-Oct-2015

1. (enh #30): Better validation for undefined groups key param.

## Version 1.4.3

**Date:** 14-Jul-2015

1. (enh #27): Better validation for value selected.
2. (enh #28): Ability to configure HTML attributes for each option element via ajax.

version 1.4.2
=============
## Version 1.4.2

**Date:** 18-Jun-2015

1. (enh #23): New property `initDepends` to set all dependent parents in the chain.
2. (enh #24): Enhancement for Select2 plugin.

version 1.4.1
=============
## Version 1.4.1

**Date:** 22-May-2015

1. (enh #19): New `depdrop_all_params` that will be sent as an associative array (keys & values) to the server ajax action.
2. (enh #20): Ability to configure `id` and `name` param names in json response.
3. (bug kartik-v/yii2-widget-depdrop#10): Fix process dependency params.
4. (enh #22): Fixes for JQuery v2.1.4 & Select2.

version 1.4.0
=============
## Version 1.4.0

**Date:** 01-Feb-2015

1. Updated trigger of afterChange event
Expand All @@ -32,30 +41,30 @@ version 1.4.0
5. (enh #15): Implement reusable constructor for extending plugin if needed.
6. (enh #16): Enhance Select2 dropdowns to show loading indicator.

version 1.3.0
=============
## Version 1.3.0

**Date:** 08-Nov-2014

1. Set release to stable in composer.json.
2. Updated CHANGE log to reflect user friendly date time formats.

version 1.2.0
=============
## Version 1.2.0

**Date:** 02-Jul-2014

- Enh #8: Ability to pass additional form input data within each ajax call.

version 1.1.0
=============
## Version 1.1.0

**Date:** 05-May-2014

- Updated placeholder to accept boolean value (false) to disable it.
- Added loadingClass property to configure the loading indicator CSS.
- Added support for plugin to work with other plugins like Select2.


version 1.0.0
=============
## Version 1.0.0

**Date:** 30-Apr-2014

Initial release.
7 changes: 5 additions & 2 deletions js/dependent-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if (sel !== null && sel.length && id.toString() === sel) {
settings.selected = "selected";
}
$("<option/>", settings).appendTo($el);
$("<option>", settings).appendTo($el);
},
setParams = function (props, vals) {
var out = {}, i, key, val;
Expand Down Expand Up @@ -129,6 +129,9 @@
$el.find('option[value=""]').attr('disabled', 'disabled');
}
if (data.output) {
if (selected && $.isArray(selected) && $el.attr('multiple')) {
$el.val(selected);
}
$el.removeAttr('disabled');
}
}
Expand Down Expand Up @@ -159,7 +162,7 @@
data = {};
}
$.each(data, function (i, groups) {
if (groups[idParam]) {
if (typeof groups[idParam] !== 'undefined') {
options = groups.options || {};
addOption($select, groups[idParam], groups[nameParam], defVal, options);
}
Expand Down
2 changes: 1 addition & 1 deletion js/dependent-dropdown.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 89f93a0

Please sign in to comment.