Skip to content

Commit

Permalink
update: 1.4.1
Browse files Browse the repository at this point in the history
独立接口增加传递所有前序选框的值
  • Loading branch information
ciaoca committed Nov 2, 2016
1 parent d8db75e commit ec3b35e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
26 changes: 14 additions & 12 deletions js/jquery.cxselect.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* jQuery cxSelect
* @name jquery.cxselect.js
* @version 1.4.0
* @date 2016-04-01
* @version 1.4.1
* @date 2016-11-02
* @author ciaoca
* @email [email protected]
* @site https://github.com/ciaoca/cxSelect
Expand Down Expand Up @@ -252,21 +252,23 @@
var _query = {};
var _queryName;
var _selectName;
var _selectValue;

cxSelect.clear.call(self, index);

// 使用独立接口
if (typeof _dataUrl === 'string' && _dataUrl.length) {
if (_indexPrev >= 0) {
if (!self.selectArray[_indexPrev].val().length) {return};

_queryName = _select.data('queryName');
_selectName = self.selectArray[_indexPrev].attr('name');

if (typeof _queryName === 'string' && _queryName.length) {
_query[_queryName] = self.selectArray[_indexPrev].val();
} else if (typeof _selectName === 'string' && _selectName.length) {
_query[_selectName] = self.selectArray[_indexPrev].val();
if (index > 0) {
for (var i = 0, j = 1; i < index; i++, j++) {
_queryName = self.selectArray[j].data('queryName');
_selectName = self.selectArray[i].attr('name');
_selectValue = self.selectArray[i].val();

if (typeof _queryName === 'string' && _queryName.length) {
_query[_queryName] = _selectValue;
} else if (typeof _selectName === 'string' && _selectName.length) {
_query[_selectName] = _selectValue;
};
};
};

Expand Down
6 changes: 3 additions & 3 deletions js/jquery.cxselect.min.js

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

0 comments on commit ec3b35e

Please sign in to comment.