Issue with renderWith Functionality
See original GitHub issueHi - I’m using angular-datatable in my applicatiion and I’m having one issue with renderWith. I am creating column dynamically as follow
$scope.dtColumns = buildDTColumns();
function buildDTColumns() {
var dtColumns = [];
visibilitySettingsList = [2,3];
for (var i = 0; i < listOfCoulmns.length; i++) {
var dtColumn = DTColumnBuilder.newColumn(listOfCoulmns[i].id).withTitle(listOfCoulmns[i].name);
if(listOfCoulmns[i].id === "firstName"){
dtColumn.renderWith(function(data, type, full) {
return full.firstName + ' ' + full.lastName;
});
}
if(listOfCoulmns[i].id === "dob"){
dtColumn.renderWith(function(data, type, full) {
var filterdDate = $filter('date')(full.dob,'MM-dd-yyyy');
return filterdDate;
}).withClass('auto-column-width');
}
if(listOfCoulmns[i].id === "ssn"){
dtColumn.renderWith(function (data, type, full){
var maskedSsn = $filter('mask')(full.ssn,'999-99-9999');
return maskedSsn;
}).withClass('auto-column-width');
}
if(listOfCoulmns[i].id === "landLine1"){
dtColumn.renderWith(function (data, type, full){
var maskedLandline = $filter('mask')(full.landLine1,'(999)-999-9999');
return maskedLandline;
}).withClass('auto-column-width');
}
if(listOfCoulmns[i].name === "Actions"){
dtColumn.notSortable().renderWith(actionsHtml);
}
if(columnSettings.visibility.indexOf(i) !== -1){
dtColumn.notVisible();
}
dtColumns.push(dtColumn);
}
// and the rest...
return dtColumns;
}
function actionsHtml(data, type, full, meta) {
$scope.patients[data.id] = data;
return '<button class="btn btn-warning" ng-click="edit(patients[' + data.patientId + '])">' +
' <i class="fa fa-edit"></i>' +
'</button> ';
}
And also I’m using reorder functionality, In actionHtml method I’m handling click event i.e edit. Now the issue is, If i use reorder functionality then i’m not getting click event for that row. If I dont use colreorder then I’am getting click event. So could you please help me to resolve this issue.
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Getting act warning when testing loading render with newest ...
My useFetch immediately updates state when the component mounts ( loading -> true ). So, could the render kicking off a state change...
Read more >Performance penalty of creating handlers on every render with ...
Hooks approach this problem from three sides. So overall benefits that hooks provide are much greater than the penalty of creating new functions....
Read more >Host a Dev Environment on Render with VS Code and Tailscale
How to host a disposable dev environment using Render, Tailscale, persistent disk, and SSH.
Read more >Stop useEffect from running on every render with useCallback
useCallback returns you a new version of your function only when its dependencies change. In the example above, that's only when a or...
Read more >Preview and render with Multi-Frame Rendering
After Effects delivers on the number one feature request, Multi-Frame Rendering. You see performance gains on your system from Preview to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hopefully you have able to reproduce the issue. If you need any more clarification please let me know.
Closing as issue is too old and the version is no longer maintained.