Some how the c.rows automatically changing back to 0 even though i have added a row
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 10:05 AM
Hi Team,
Some how the c.rows in the client controller script(custom variable) automatically changing back to 0 even though i have added a row, I have used this custom variable and widget in my record producer to replica the OOB MRVs.
HTML:
<div>
<p><strong><span style="font-size: 14pt; background-color: rgb(194, 224, 244);">Please list the names of the organization and individuals that ultimately control ≥ 25% of the organization's shares</span></strong></p>
<br>
<div class="table-container">
<table class="responsive-table">
<thead>
<tr>
<th></th>
<th>S.No</th> <!-- Auto-increment column -->
<th>Organization</th>
<th>Title/Position <span style="color:red;">*</span></th>
<th>First Name <span style="color:red;">*</span></th>
<th>Middle Name</th>
<th>Last Name <span style="color:red;">*</span></th>
<th>Street <span style="color:red;">*</span></th>
<th>City <span style="color:red;">*</span></th>
<th>State/Province <span style="color:red;">*</span></th>
<th>Country <span style="color:red;">*</span></th>
<th>Postal/Zip Code <span style="color:red;">*</span></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in c.rows track by $index">
<td><button class="btn btn-danger" ng-click="c.removeRow($index)">Remove</button></td>
<td>{{ $index + 1 }}</td> <!-- Auto-incrementing number -->
<td><textarea ng-model="row.organization" placeholder="Organization" rows="3" cols="30" oninput="limitLines(this, 3)"></textarea></td>
<td><input type="text" ng-model="row.titleposition" placeholder="Title/Position" required /></td>
<td><input type="text" ng-model="row.firstName" placeholder="First Name" required /></td>
<td><input type="text" ng-model="row.middleName" placeholder="Middle Name" /></td>
<td><input type="text" ng-model="row.lastName" placeholder="Last Name" required /></td>
<td><input type="text" ng-model="row.street" placeholder="Street" required /></td>
<td><input type="text" ng-model="row.city" placeholder="City" required /></td>
<td><input type="text" ng-model="row.state" placeholder="State/Province" required /></td>
<td><input type="text" ng-model="row.country" placeholder="Country" required /></td>
<td><input type="text" ng-model="row.postalcode" placeholder="Postal/Zip Code" required /></td>
<td><input type="hidden" ng-model="row.fieldName" value="{{ c.fieldName }}" /></td>
</tr>
</tbody>
</table>
<button class="btn btn-primary" ng-click="c.addRow()">Add</button>
<div class="alert alert-danger" ng-if="clientError" style="white-space: pre-wrap;">
<i class="fa fa-exclamation-triangle"></i> {{clientError}}
</div>
</div>
</div>
Client controller script: