Function row.select( ) not available

Function row.select( ) not available

rplantikorplantiko Posts: 18Questions: 1Answers: 0

Link to test case: https://live.datatables.net/gefemike/595/edit
Error messages shown: Uncaught TypeError: row.select is not a function
Description of problem: I want to place a certain row (given by a certain cell content) in the visible section of the table when it is loaded. The forum post https://datatables.net/forums/discussion/54528/ gave a perfect solution for this problem, involving the row( ).show( ) plugin. Unfortunately. the solution is broken by a newer version of datatables.

In the following code snippet of the example given by kthorngren in the above post:

    var row = table.row(function ( idx, data, node ) {
      return data[0] === 'Quinn Flynn';
    } );
    if (row.length > 0) {
      row.select()
      .show()
      .draw(false);
    }

The row object retrieved by table.row( ) will no longer support the select() function

How to proceed?

Kind regards,
Rüdiger

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 19,864Questions: 26Answers: 4,685
    Answer ✓

    Add the Select extension. Here is the updated example:
    https://live.datatables.net/gefemike/596/edit

    Use the Download Builder to get the appropriate extensions for your solution.

    Kevin

  • kthorngrenkthorngren Posts: 19,864Questions: 26Answers: 4,685

    If you don't want to select the row remove the .select() part of the above statement and just the page with the row will be displayed.

    Kevin

  • rplantikorplantiko Posts: 18Questions: 1Answers: 0

    Thank you, Kevin, that was quick!

    To summarize:

    Now a further plugin for select() is necessary additionally - the row().show() plugin alone is not sufficient.

    At least if the row selection is required - in some cases it may be sufficient to display the right table section, then I would go along with simply removing the .select() part.

    Have a nice day!
    Rüdiger

  • kthorngrenkthorngren Posts: 19,864Questions: 26Answers: 4,685
    edited October 2023

    Now a further plugin for select() is necessary additionally - the row().show() plugin alone is not sufficient.

    No. Select extension is not required. It is required if you want to select the row with .select(). It is used in the example just to highlight the row. Here is your original example with .select() removed and no Select extension:
    https://live.datatables.net/gefemike/597/edit

    Kevin

Sign In or Register to comment.