I am working on an angularJS project. I am trying to display a part of data within the main json data with 5000 to 9000 lines in the view using ng-repeat. There is a table data tag which is used to show checkbox or radio button using the css image the code is as follows.
<tr ng-repeat="o in main[menu].options" >
<td style="width:10%;" class="radio"
ng-class="{checked: main[menu][active].active === o.instanceId}"
ng-click="main[menu][active].active = o.instanceId;"
ng-if="menu === 'requiredOptionGroups'">
</td>
<td>..some other data...</td>
</tr>
for check box:
<tr ng-repeat="o in main[menu].options" >
<td style="width: 10%;" class="checkbox"
ng-class="{checked: o.preSelect == 'true'}"
ng-click="o.preSelect = o.preSelect=== 'false'?'true':'false';"
ng-if="menu === 'optionalOptionGroups'" ng-model="o.preSelect">
</td>
<td>..some other data...</td>
</tr>
the css classes for radio and checkbox is as follows:
.checkbox {
cursor: pointer;
background: url(./images/check_box_empty.png) no-repeat center center;
height: 22px;
width: 22px;
&.checked { background: url(./images/check_box_checked.png) no-repeat center center; }
}
.radio {
cursor: pointer;
background: url(./images/radio_button_empty.png) no-repeat center center;
height: 22px;
width: 22px;
&.checked { background: url(./images/radio_button_filled.png) no-repeat center center; }
}
the issue i am facing is that when user tries to click the radio button or check box button there is noticeable delay before the checked image is shown.
The code works fine for much smaller data .
Is there any work around so that i can overcome the delay. I have searched to improve the performance at link but we have to show all data to the user