Roo/bootstrap/form/MultiLineTag.js
authorleon <leon@roojs.com>
Wed, 1 Nov 2023 08:34:15 +0000 (16:34 +0800)
committerleon <leon@roojs.com>
Wed, 1 Nov 2023 08:34:15 +0000 (16:34 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/form/MultiLineTag.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index dcd701b..f457e62 100644 (file)
@@ -169,7 +169,6 @@ Roo.extend(Roo.bootstrap.form.MultiLineTag, Roo.bootstrap.form.Input,  {
         row.destroy();
         this.tagRows.splice(this.tagRows.indexOf(row), 1);
         this.fireEvent('change', this, this.getValue(), false);
-
         this.showHideRemoveBtn();
     },
 
index 98254a6..9fca5ca 100644 (file)
@@ -14918,6 +14918,14 @@ Roo.extend(Roo.bootstrap.form.MultiLineTag, Roo.bootstrap.form.Input,  {
         return ret;
     },
 
+    removeTagRow : function(row)
+    {
+        row.destroy();
+        this.tagRows.splice(this.tagRows.indexOf(row), 1);
+        this.fireEvent('change', this, this.getValue(), false);
+        this.showHideRemoveBtn();
+    },
+
     // show remove buttons only if there are more than {minimumRow} tags
     showHideRemoveBtn : function()
     {
@@ -14961,7 +14969,9 @@ Roo.extend(Roo.bootstrap.form.MultiLineTag, Roo.bootstrap.form.Input,  {
         }
 
         if(arr.length < this.tagRows.length) {
+            for(; i < this.tagRows.length; i ++) {
 
+            }
         }
         
         
index 966acb9..0429120 100644 (file)
@@ -632,9 +632,9 @@ Roo.bootstrap.form.MultiLineTag=function(A){Roo.bootstrap.form.MultiLineTag.supe
 }},proxy:{xns:Roo.data,xtype:'HttpProxy',method:'GET',url:A.url},reader:{xns:Roo.data,xtype:'JsonReader',fields:A.fields}},listeners:{'render':function(E){E.inputEl().on('keyup',function(e){if(A.shouldAutoAddTagRow()){A.addTagRow();}});E.inputEl().on('change',function(e){A.fireEvent('change',A,A.getValue(),false);
 });},'select':function(E,F,G){A.fireEvent('change',A,A.getValue(),false);}}});var C=Roo.factory({xns:Roo.bootstrap,xtype:'Button',html:'-'});var D={xns:Roo.bootstrap,xtype:'Row',items:[B,C],listeners:{'render':function(E){this.inputCb=B;this.removeBtn=C;this.removeBtn.on('click',function(){E.destroy();
 A.tagRows.splice(A.tagRows.indexOf(E),1);A.showHideRemoveBtn();A.fireEvent('change',A,A.getValue(),false);});}}};this.tagRows.push(this.addxtype(D));A.showHideRemoveBtn();},shouldAutoAddTagRow:function(){var A=true;Roo.each(this.tagRows,function(r){if(r.inputCb.getRawValue()==''){A=false;
-}});return A;},showHideRemoveBtn:function(){var A=this;Roo.each(this.tagRows,function(r){r.removeBtn.show();if(A.tagRows.length<=A.minimumRow){r.removeBtn.hide();}});},getValue:function(){var A=this;var B=[];Roo.each(A.tagRows,function(r){var C=r.inputCb.getRawValue();
-if(C!=''){var D={};D[A.valueField]=r.inputCb.getRawValue();B.push(D);}});return JSON.stringify(B);},setValue:function(A){var B=JSON.parse(A);var i=0;for(;i<B.length;i++){if(this.tagRows.length==i){this.addTagRow();}this.tagRows[i].inputCb.setRawValue(B[i][this.valueField]);
-}if(B.length<this.tagRows.length){}}});
+}});return A;},removeTagRow:function(A){A.destroy();this.tagRows.splice(this.tagRows.indexOf(A),1);this.fireEvent('change',this,this.getValue(),false);this.showHideRemoveBtn();},showHideRemoveBtn:function(){var A=this;Roo.each(this.tagRows,function(r){r.removeBtn.show();
+if(A.tagRows.length<=A.minimumRow){r.removeBtn.hide();}});},getValue:function(){var A=this;var B=[];Roo.each(A.tagRows,function(r){var C=r.inputCb.getRawValue();if(C!=''){var D={};D[A.valueField]=r.inputCb.getRawValue();B.push(D);}});return JSON.stringify(B);
+},setValue:function(A){var B=JSON.parse(A);var i=0;for(;i<B.length;i++){if(this.tagRows.length==i){this.addTagRow();}this.tagRows[i].inputCb.setRawValue(B[i][this.valueField]);}if(B.length<this.tagRows.length){for(;i<this.tagRows.length;i++){}}}});
 // Roo/data/SortTypes.js
 Roo.data.SortTypes={none:function(s){return s;},stripTagsRE:/<\/?[^>]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"");},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"");},asUCString:function(s){return String(s).toUpperCase();
 },asDate:function(s){if(!s){return 0;}if(s instanceof Date){return s.getTime();}return Date.parse(String(s));},asFloat:function(s){var A=parseFloat(String(s).replace(/,/g,""));if(isNaN(A)){A=0;}return A;},asInt:function(s){var A=parseInt(String(s).replace(/,/g,""));