question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with renderWith Functionality

See original GitHub issue

Hi - 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>&nbsp;';

    }

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:closed
  • Created 7 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dnyaneshwaruttarwarcommented, Sep 1, 2016

Hopefully you have able to reproduce the issue. If you need any more clarification please let me know.

0reactions
l-lincommented, Nov 25, 2017

Closing as issue is too old and the version is no longer maintained.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found