X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fform%2FComboBoxArray.js;h=6ecd3e06d7ba66cf2b1479dcd0f6c80451a3fa0b;hb=a0ba012039e40071aea839b93dc8562a79389ab0;hp=6bbec5593f3eb91f580a382552ba28461e6cf681;hpb=08a9660f7c3401485f38e7913d88ba483685b4ee;p=roojs1 diff --git a/Roo/form/ComboBoxArray.js b/Roo/form/ComboBoxArray.js index 6bbec5593f..6ecd3e06d7 100644 --- a/Roo/form/ComboBoxArray.js +++ b/Roo/form/ComboBoxArray.js @@ -36,6 +36,16 @@ Roo.form.ComboBoxArray = function(config) { + this.addEvents({ + /** + * @event remove + * Fires when remove the value from the list + * @param {Roo.form.ComboBox} combo This combo box + */ + 'remove' : true + + + }); Roo.form.ComboBoxArray.superclass.constructor.call(this, config); @@ -350,6 +360,31 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField, validateValue : function(value){ return Roo.form.ComboBoxArray.superclass.validateValue.call(this, this.getValue()); + }, + + /*@ + * overide + * + */ + isDirty : function() { + if(this.disabled) { + return false; + } + + try { + var d = Roo.decode(String(this.originalValue)); + } catch (e) { + return String(this.getValue()) !== String(this.originalValue); + } + + var originalValue = []; + + for (var i = 0; i < d.length; i++){ + originalValue.push(d[i][this.valueField]); + } + + return String(this.getValue()) !== String(originalValue.join(',')); + } }); @@ -422,10 +457,13 @@ Roo.extend(Roo.form.ComboBoxArray.Item, Roo.BoxComponent, { remove : function() { - + Roo.log(this); this.cb.items.remove(this); this.el.child('img').un('click', this.remove, this); this.el.remove(); this.cb.updateHiddenEl(); + + Roo.log('remove?????'); + this.cb.fireEvent('remove', this); } }); \ No newline at end of file