this.combo.onRender(ct, position);
// assigned so form know we need to do this..
- this.store = this.combo.store;
+ this.store = this.combo.store;
+ this.valueField = this.combo.valueField;
+ this.displayField = this.combo.displayField ;
this.combo.wrap.addClass('x-cbarray-grp');
{
- var _this = this;
- Roo.each(v, function(l) {
- _this.addItem(l);
- });
+ if (this.store.isLocal) {
+ // then we can use the store to find the values..
+ // comma seperated at present.. this needs to allow JSON based encoding..
+ this.hiddenEl.value = v;
+ var v_ar = [];
+ Roo.each(v.split(','), function(k) {
+ Roo.log("CHECK " + this.valueField + ',' + k);
+ var li = this.store.query(this.valueField, k);
+ if (!li.length) {
+ return;
+ }
+ add = {};
+ add[this.valueField] = k;
+ add[this.displayField] = li.item(0).data[this.displayField];
+
+ this.addItem(add);
+ }, this)
+
+
+
+ }
+
},
setFromData: function(v)
{
- Roo.log(v);
+ // this recieves an object, if setValues is called.
+ var keys = v[this.valueField].split(',');
+ var display = v[this.displayField].split(',');
+ for (var i = 0 ; i < keys.length; i++) {
+
+ add = {};
+ add[this.valueField] = keys[i];
+ add[this.displayField] = values[i];
+
+ }
},