ng-click is not working inside the responsive view
ng-click is not working inside the responsive view(child row)

As mentioned in screen shot i have buttons inside the child rows,ng-click is not working on that buttons
Thanks in advance
Are you using the responsive extension? Can you share your code?
the same problem happens to me, I have a button in a row in the table, but at the time of be responsive does not work ng-click.


the buttons are not working
the same thing is happening with me :(
See #209.
@l-lin
I am using angular-datatables - v0.5.5 and Responsive 2.0.2.
When I click on thumbs Up in child, ng-click don't work. I have modified my code as you mentioned in above like in #209.
Below is my code , please advise

Thank you @Ramanjineyulu , @yasser-kfupm , @Hansel03 any luck ????
It must be a css issue. Check your DOM if there are any overlapping divs that blocks your element that has ng-click.
@dashawk . no css is not causing any issue. even if I remove css. @l-lin any advise???
Can you reproduce it in jsfiddle or plunkr?
@dashawk & @l-lin I have placed a sample code at Plunker https://plnkr.co/edit/51PrmG3dexxsvSuOhZxZ?p=preview
Run this app in mobile or tablet [responisve port view], there is a column called 'Country5' , click it's any value in Datatables Responsive, its alert would never work.
I see your plunkr got an error, i just removed the ng in datatables="" for your plunkr to work... Anyway, I found your error, it is definitely a css issue. Your css for table.dataTable.dtr-column>tbody>tr>td.control:before, table.dataTable.dtr-column>tbody>tr>th.control:before is causing the problem.
You see this style is overlapping above your <a> tag where you put your ng-click.
To resolve it, put your ng-click in the <td> tag then it should work. Your alert will show then after you click the ok button, the drop down will also work.
Hope I explained it clearly.
Thank you @dashawk , I tried the way you have said. but it's still not working. Following css code is the default css code for Datatables. "table.dataTable.dtr-column>tbody>tr>td.control:before, table.dataTable.dtr-column>tbody>tr>th.control:befo" @l-lin any advise please
@dashawk : if you want you can use the following code to run local, after including default library & css files of Datatables , Angularjs , JQuery etc
`
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.7/css/jquery.dataTables.css">
</head>
<body>
<div ng-app="AngularWayApp" ng-controller="AngularWayCtrl">
<table datatable="ng" class="table" dt-options="dtOptions">
<thead>
<tr>
<th>Name</th>
<th>City</th>
<th>Country1</th>
<th>Country2</th>
<th>Country3</th>
<th>Country4</th>
<th>Country5</th>
<th>Country6</th>
<th>Country7</th>
<th>Country8</th>
<th>Country9</th>
<th/>
</tr>
</thead>
<tbody>
<tr ng-repeat="name in names" ng-click="testingClick(name)">
<td>{{name.Name}}</td>
<td>{{name.City}}</td>
<td>{{name.Country + 1}}</td>
<td>{{name.Country + 2}}</td>
<td>{{name.Country + 3}}</td>
<td>{{name.Country + 4}}</td>
<td>{{name.Country + 5}}</td>
<td>{{name.Country + 6}}</td>
<td>{{name.Country + 7}}</td>
<td>{{name.Country + 8}}</td>
<td>
<a href="" class="hover" ng-click='TestClick("hello")'>{{name.Country + 9}}</a>
</td>
<td/>
</tr>
</tbody>
</table>
<script>
var app = angular.module('AngularWayApp', ['datatables']);
app.controller('AngularWayCtrl', ['$scope','$http','DTOptionsBuilder',function($scope, $http, DTOptionsBuilder )
{
var responsive = { details: { type: 'column', target: -1 } };/* Show responsive column on right */
var columnDefs = [{ className: 'control', orderable: false, targets: -1 }];
$scope.TestClick = function (msg)
{
alert(msg);
};
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withPaginationType('full_numbers')
.withOption('paging', false)
.withOption('searching', false)
.withOption('responsive', responsive)
.withOption('columnDefs', columnDefs)
.withOption('bInfo', false);
$http.get("http://www.w3schools.com/angular/customers_mysql.php").success(function (response)
{
$scope.names = response.records;
});
$scope.testingClick = function(name)
{
console.log(name);
};
}]);
</script>
</div>
</body>
`
any solution?
click event is not working in the responsive view still, any solution to it?
i am facing the same problem. any solution?? thanks
Hi guys, sorry for the very long reply on this issue.
Here is my solution and it works well.
You must inject $compile in your controller.
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withPaginationType('full_numbers')
.withOption('paging', false)
.withOption('searching', false)
.withOption('responsive', responsive)
.withOption('columnDefs', columnDefs)
.withOption('bInfo', false);
// Add this option in your dtOptions
.withOption('createdRow', function (row, data, index) {
row.setAttribute('ng-click', 'TestClick()');
$compile(angular.element(row))($scope);
});
$scope.TestClick = function () {
console.log('clicked');
};
Any solutions?
.withOption('responsive', {
details: {
renderer: function (api, rowIdx, columns) {
var data = $.map(columns, function (col, i) {
return col.hidden ?
'<tr data-dt-row="' + col.rowIndex + '" data-dt-column="' + col.columnIndex + '">' +
'<td>' + col.title + ':' + '</td> ' +
'<td>' + col.data + '</td>' +
'</tr>' :
'';
}).join('');
var res = data ? $('<table/>').append(data) : false;
if (res)
$compile(angular.element(res).contents())($scope);
return res;
},
type: 'column',
target: 0
}
})
esa la solucion al problema
Saludos @MohammedAslam199
Any solutions?
so what is the solution? the problem still there at my side with ver 0.6.4. pls advice @l-lin