Get cells from selected row.

Get cells from selected row.

bySabibySabi Posts: 2Questions: 1Answers: 0

How I can get cells from a row without selector, like ...?

table.row(2).cells()

maybe on roadmap or future ??

Answers

  • bySabibySabi Posts: 2Questions: 1Answers: 0

    Aswered my self

    /**
     * This plug-in will get all cells from a selected row, returning
     * a DataTables API instance with selected cells
     *
     *  @name row().rowCells()
     *  @summary Get all cells from selected row
     *  @author bySabi Files
     *  @requires DataTables 1.10+
     *
     * @returns {DataTables} API instance with selected cells
     *
     *  @example
     *    // Get all cells from row 1
     *    var table = $('#example').DataTable();
     *    table.row( 1 ).rowCells();
     */
    
    $.fn.dataTable.Api.register('row().rowCells()', function () {
        return this.cells(this.index(),this.columns()[0]);
    });
    
    
This discussion has been closed.