The below code does not seem to work when the dialog is launched for the first time.
$scope.ke_location_channel_summary = function (region_id, region) {
$scope.region_data = $scope.location_channel_data[region_id];
killed_enquiries_services.open_dialog('popup', region);
$('#popup').html($('#location_channel_summary').html());
};
But it works with the below change
$scope.ke_location_channel_summary = function (region_id, region) {
$scope.region_data = $scope.location_channel_data[region_id];
window.setTimeout(function () {
killed_enquiries_services.open_dialog('popup', region);
$('#popup').html($('#location_channel_summary').html());
}, 0);
};
The HTML side of the code is
<div id="location_channel_summary" style="display: none">
<table class="standardTable">
<tr>
<th class="left-col-heading">Channel</th>
<th class="center">Qty</th>
<th class="center">Nights</th>
<th class="center">Value</th>
<th class="center">Avg Value</th>
<th class="center">ADR</th>
</tr>
<tr ng-repeat="ctype in contacttypes | orderBy:['sort_order']">
<td style="width:25%;" class="left-col-td">{{ctype.name}}</td>
<td ng-repeat="column in columns" class="center">{{region_data[ctype.id][column]}}</td>
</tr>
</table>
I'm trying to display the div content on the Jquery Dialog. The table is returned with blank content without the setTimeOut. Why is this so ?