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

Roo/bootstrap/form/MultiLineTag.js
examples/bootstrap4/multiLineTag.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 447bedd..dd0c8d1 100644 (file)
@@ -202,7 +202,7 @@ Roo.extend(Roo.bootstrap.form.MultiLineTag, Roo.bootstrap.form.Input,  {
             if(this.tagRows.length == i) {
                 this.addTagRow();
             }
-            this.tagRows[i].inputCb.setRawValue(arr[0][this.valueField]);
+            this.tagRows[i].inputCb.setRawValue(arr[i][this.valueField]);
         }
         
         
index 139ea0e..d436e0d 100644 (file)
@@ -40,7 +40,7 @@ Roo.example.multiLineTag = new Roo.XComponent({
                                                     Roo.log('ON CHANGE');
                                                     Roo.log(newValue);
                                                     Roo.log(_self.getValue());
-                                                    _self.setValue('[{"name":"dc"},{"name":"a"}]');
+                                                    _self.setValue('[{"name":"dc"},{"name":"a"},{"name":"we"}]');
                                                 }
                                             }
                                         } 
index 66b9488..4c37b66 100644 (file)
@@ -14956,7 +14956,7 @@ Roo.extend(Roo.bootstrap.form.MultiLineTag, Roo.bootstrap.form.Input,  {
             if(this.tagRows.length == i) {
                 this.addTagRow();
             }
-            this.tagRows[i].inputCb.setRawValue(arr[0][this.valueField]);
+            this.tagRows[i].inputCb.setRawValue(arr[i][this.valueField]);
         }
         
         
index 1338072..91fb6a6 100644 (file)
@@ -633,7 +633,7 @@ Roo.bootstrap.form.MultiLineTag=function(A){Roo.bootstrap.form.MultiLineTag.supe
 });},'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);for(var i=0;i<B.length;i++){if(this.tagRows.length==i){this.addTagRow();}this.tagRows[i].inputCb.setRawValue(B[0][this.valueField]);
+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);for(var i=0;i<B.length;i++){if(this.tagRows.length==i){this.addTagRow();}this.tagRows[i].inputCb.setRawValue(B[i][this.valueField]);
 }}});
 // 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();