Roo/bootstrap/form/MultiLineTag.js
authorleon <leon@roojs.com>
Fri, 3 Nov 2023 04:23:19 +0000 (12:23 +0800)
committerleon <leon@roojs.com>
Fri, 3 Nov 2023 04:23:19 +0000 (12:23 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index 6bb9a76..2ca8e1b 100644 (file)
@@ -160,7 +160,7 @@ Roo.extend(Roo.bootstrap.form.MultiLineTag, Roo.bootstrap.form.Input,  {
         return ret;
     },
 
-    removeTagRow : function(row,)
+    removeTagRow : function(row)
     {
         row.destroy();
         this.tagRows.splice(this.tagRows.indexOf(row), 1);
index a6fc153..434952c 100644 (file)
@@ -14914,7 +14914,7 @@ Roo.extend(Roo.bootstrap.form.MultiLineTag, Roo.bootstrap.form.Input,  {
         return ret;
     },
 
-    removeTagRow : function(row,)
+    removeTagRow : function(row)
     {
         row.destroy();
         this.tagRows.splice(this.tagRows.indexOf(row), 1);
index 2aec235..0fc14ff 100644 (file)
@@ -632,7 +632,7 @@ 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);
 A.showHideRemoveBtn();});},'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(){A.removeTagRow(E);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;},removeTagRow:function(A,){A.destroy();this.tagRows.splice(this.tagRows.indexOf(A),1);this.showHideRemoveBtn();},showHideRemoveBtn:function(){var A=this;Roo.each(this.tagRows,function(r){r.removeBtn.show();if(A.tagRows.length<=A.minimumRow||r.inputCb.getRawValue()==''){r.removeBtn.hide();
+}});return A;},removeTagRow:function(A){A.destroy();this.tagRows.splice(this.tagRows.indexOf(A),1);this.showHideRemoveBtn();},showHideRemoveBtn:function(){var A=this;Roo.each(this.tagRows,function(r){r.removeBtn.show();if(A.tagRows.length<=A.minimumRow||r.inputCb.getRawValue()==''){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=this.tagRows.length;for(var i=0;
 i<B;i++){this.removeTagRow(this.tagRows[0]);}var C=[];try{C=JSON.parse(A);}catch{}for(var i=0;i<C.length;i++){this.addTagRow();this.tagRows[i].inputCb.setRawValue(C[i][this.valueField]);}this.addTagRow();while(this.tagRows.length<this.minimumRow){this.addTagRow();
 }},getChildContainer:function(){return Roo.select('.roo-multi-line-tag-container',true).elements[0];}});