Searchbuilder result + select all + editor button edits the unfiltered data table

Searchbuilder result + select all + editor button edits the unfiltered data table

d00mboyd00mboy Posts: 10Questions: 5Answers: 0

Link to test case: https://daidev.oliverdbconsulting.com/pfl/pfl-cop30-t-12-1-SEARCH.html
Debugger code (debug.datatables.net): n/a
Error messages shown: n/a
Description of problem: After using searchbuilder to filter the displayed rows, then using the built-in Select All button, if I copy or export, I get the expected, filtered set of rows, but if I open with Editor button, and make a multi-edit, it is applied to all of the rows (as if Searchbuilder criteria not applied).

This question has an accepted answers - jump to answer

Answers

  • d00mboyd00mboy Posts: 10Questions: 5Answers: 0

    Looks like this occurs in example code as well, without using the searchbuilder extension:

    https://editor.datatables.net/examples/extensions/import.html

    (if you type a search criteria in box, then select all, then edit, it will be editing all rows not just the ones meeting search criteria. If you instead Export CSV it will only have the search criteria rows).

  • kthorngrenkthorngren Posts: 21,184Questions: 26Answers: 4,925
    Answer ✓

    The selectAll docs state this:

    The selectAll button will simply select all items in the table

    You could create a Custom Button and use rows().select() with the selector-modifier of {search: 'applied'} to select the rows based on the search results.

    Kevin

  • d00mboyd00mboy Posts: 10Questions: 5Answers: 0

    Thank you! Below is how I did that if it helps someone else just starting out:

    {
    text: 'Select Current',
    action: function (){
    table.rows({search: 'applied'}).select()
    }

This discussion has been closed.