# i want to add dynamic fields inside for loop in extjs

**URL:** <https://forum.shopware.com/t/i-want-to-add-dynamic-fields-inside-for-loop-in-extjs/36831>\
**Category:** Shopware 5\
**Created:** [18. Mai 2016 um 15:20 UTC](https://forum.shopware.com/t/i-want-to-add-dynamic-fields-inside-for-loop-in-extjs/36831 "2016-05-18T15:20:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alirizvi](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@alirizvi](https://forum.shopware.com/u/alirizvi)\
**Post date:** [18. Mai 2016 um 15:20 UTC](https://forum.shopware.com/t/i-want-to-add-dynamic-fields-inside-for-loop-in-extjs/36831/1 "2016-05-18T15:20:31Z")

</div>

createFormContent: function () {  
&nbsp;&nbsp; &nbsp;var me = this;  
&nbsp;&nbsp; &nbsp;var result;  
&nbsp;&nbsp; &nbsp;Ext.Ajax.request({  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;url: ‘{url controller="" action=""}’,  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;params: {  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;success: function (response) {  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;result = JSON.parse(response.responseText);  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;alert(result.count);  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for (var i = 1; i \<= result.count; i++) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;me.customField+i = Ext.create(‘Ext.form.field.Text’, {  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;name: ,  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fieldLabel: ,  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;anchor: ‘95%’,  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;labelWidth: 150,  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;width: ‘95%’  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;});  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}  
&nbsp;&nbsp; &nbsp;});  
},

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [18. Mai 2016 um 16:42 UTC](https://forum.shopware.com/t/i-want-to-add-dynamic-fields-inside-for-loop-in-extjs/36831/2 "2016-05-18T16:42:51Z")

</div>

Are you seriously expecting an answer when you are obviously even too lazy to write one complete sentence?

Good luck
