Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

How do I get "data" in a click event handler?

$
0
0

In the below code I'm trying to put a button (icon) in the cell(column) and trigger page location change on the Controller. I cannot seem to get "data" in the .click function on line 22. New in this arena so info help is appreciated.

    columnDefs: [
                    {
                        className: 'control responsive',
                        orderable: false,
                        render: function () {
                            return '';
                        },
                        targets: 0
                    },
                    {
                        targets: 1,
                        data: null,
                        orderable: false,
                        defaultContent: '',
                        rowAction: {
                            element: $("<div/>")
                                .addClass("text-center")
                                .append($("<button/>")
                                    .addClass("btn btn-outline-primary btn-sm btn-icon")
                                    .attr("title", app.localize("Open Document"))
                                    .append($("<i/>").addClass("la la-search"))
                                ).click(function (data) {
                                    document.location.href = abp.appPath + "App/CustomersAndAccounts/ViewCustomerDetail?id=1";
                                })
                        }
                    },

Viewing all articles
Browse latest Browse all 81728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>