Open delphiassistant opened 4 years ago
@delphiassistant try this
<div class="inner-repeater">
<div data-repeater-list="inner-list">
<div data-repeater-item>
<div class="form-group">
<label class="control-label">کالای مورد نظر</label>
<select class="form-control" id="OrderDetails[0].ProductID" name="OrderDetails[0].ProductID">
<option value="1">هویج</option>
<option value="2">گلابی</option>
</select>
</div>
<div class="form-group">
<label class="control-label">تعداد کالا</label>
<input id="OrderDetails[0].ProductCount" name="OrderDetails[0].ProductCount" class="form-control" />
</div>
<input data-repeater-delete type="button" value="حذف" />
</div>
<hr />
<div data-repeater-item>
<div class="form-group">
<label class="control-label">کالای مورد نظر</label>
<select class="form-control" id="OrderDetails[1].ProductID" name="OrderDetails[1].ProductID">
<option value="1">هویج</option>
<option value="2">گلابی</option>
</select>
</div>
<div class="form-group">
<label class="control-label">تعداد کالا</label>
<input id="OrderDetails[1].ProductCount" name="OrderDetails[1].ProductCount" class="form-control" />
</div>
<input data-repeater-delete type="button" value="حذف" />
</div>
</div>
</div>
<hr />
I created an edit form based on repeater plugin. When loading form, I created html using server side code (in ASP.NET Core) which looks like this:
As you can see, I set indexes in rendered html manually like: OrderDetails[0].ProductCount OrderDetails[1].ProductCount
Then I added code for activating repeater and it works, but indexes does not start from 2 (since I created 0 and 1 indexes in my rendered html).
Any Ideas?