preSelect not preSelecting (columnDef: show, preSelect | data: array) [Example included]

preSelect not preSelecting (columnDef: show, preSelect | data: array) [Example included]

SyncOrSwimSyncOrSwim Posts: 2Questions: 1Answers: 0

Link to test case: http://live.datatables.net/varojuja/1/edit?html,js,output
Debugger code (debug.datatables.net): N/A
Error messages shown: NA
Description of problem: The 'Active' option should preselect, but it does not.

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @SyncOrSwim ,

    You are initialising your table before the data is present. When SearchPanes tries to preselect the value it is not present so it cannot select it. This example shows how it should be done.

    Thanks,
    Sandy

  • SyncOrSwimSyncOrSwim Posts: 2Questions: 1Answers: 0
    edited August 2021

    Okay, that helped. I am occasionally refreshing the data but calling destroy and re-initializing does seem to work.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    @SyncOrSwim - could you update Sandy's test case to demonstrate that, please, and we'll take a look,

    Colin

Sign In or Register to comment.