|
|
|
@ -40,6 +40,18 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return text; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getItemsByTimes: function (items, times) { |
|
|
|
|
var res = []; |
|
|
|
|
for (var i = (times - 1) * this._const.perPage; items[i] && i < times * this._const.perPage; i++) { |
|
|
|
|
res.push(items[i]); |
|
|
|
|
} |
|
|
|
|
return res; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_hasNextByTimes: function (items, times) { |
|
|
|
|
return times * this._const.perPage < items.length; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_itemsCreator: function (options, callback) { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
if (!o.cache || !this.items) { |
|
|
|
@ -50,6 +62,7 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
} else { |
|
|
|
|
call(this.items); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function call(items) { |
|
|
|
|
var keywords = (options.keywords || []).slice(); |
|
|
|
|
if (options.keyword) { |
|
|
|
@ -81,8 +94,8 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
callback({ |
|
|
|
|
items: resultItems, |
|
|
|
|
hasNext: false |
|
|
|
|
items: self._getItemsByTimes(resultItems, options.times), |
|
|
|
|
hasNext: self._hasNextByTimes(resultItems, options.times) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|