bug: source loaded twice if sourceCache = true

This commit is contained in:
vitalets
2013-01-08 13:33:09 +04:00
parent 2fd6340b03
commit f06b5c4d01
8 changed files with 68 additions and 43 deletions

View File

@@ -32,6 +32,9 @@ $(function(){
$.extend(Checklist.prototype, {
renderList: function() {
var $label, $div;
this.$tpl.empty();
if(!$.isArray(this.sourceData)) {
return;
}

View File

@@ -17,8 +17,6 @@ List - abstract class for inputs that have source option loaded from js array or
var deferred = $.Deferred();
this.error = null;
this.sourceData = null;
this.prependData = null;
this.onSourceReady(function () {
this.renderList();
deferred.resolve();

View File

@@ -30,12 +30,14 @@ $(function(){
$.extend(Select.prototype, {
renderList: function() {
this.$input.empty();
if(!$.isArray(this.sourceData)) {
return;
}
for(var i=0; i<this.sourceData.length; i++) {
this.$tpl.append($('<option>', {value: this.sourceData[i].value}).text(this.sourceData[i].text));
this.$input.append($('<option>', {value: this.sourceData[i].value}).text(this.sourceData[i].text));
}
this.setClass();