Hot to access the data of the first cell for a button url paramater

Hot to access the data of the first cell for a button url paramater

webvisionwebvision Posts: 10Questions: 7Answers: 0
edited November 2015 in DataTables 1.10

I'm trying to create a button action that passes the data of the first cell as a URL variable for row (id). After updating to 1.10 the original code is failing...

ORIGINAL CODE:

fnClick: function ( button, config ) {
                    var data = this.fnGetSelectedData();
                    if ( ! data.length ) {
                      return;
                    }
                    window.location.assign('index.cfm?pf=1&cid=<cfoutput>#VARIABLES.cid#</cfoutput>&wid='+data[0].id);
                  }

NEW CODE (Failing to pass Row ID):

var table = $('#form').DataTable( {
        dom: "Bfrtip",
        ajax: "/report_modules/training/act/trainingtypes.php",
        rowId: "id",
        columns: [
            { data: "id" },
            { data: "training_type" },
            { data: "training_desc" }
        ],
        select: true,
        buttons: [
            { extend: "create", editor: editor },
            { extend: "edit",   editor: editor },
            { extend: "remove", editor: editor },
            {
                extend: "selectedSingle",
                text: "View Detail"
           }
        ]
    } );
    $("#form").on('click', '.buttons-selected-single', function() {
    alert('Row index: ' + $(this).closest('tr').index());
    });

Answers

This discussion has been closed.