Is it possible to enable and disable select extension?

Is it possible to enable and disable select extension?

bworsfoldbworsfold Posts: 14Questions: 4Answers: 0

Basically, I need to be able to have a table with an initial state of select not enabled. Then user needs to be able to select (ie. user goes into edit mode), then sometime later, the user should not be able to select rows (ie. no longer in edit mode). Just wondering if there is an easy way to do this? I know I can change the style at runtime, I just am not able to disable row select once it is active. Suggestions?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Answer ✓

    Yes - use the select.style() method. Setting it to api means that rows can still be selected, but only via the API (i.e. the end user can't).

    Allan

  • bworsfoldbworsfold Posts: 14Questions: 4Answers: 0

    That did it Allan. It makes sense now. That said, select=false would be pretty sweet... Just more readable. Because I don't really want to be able to programatically select rows.

    Thanks again for the insight.

    Brad

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    I thought about that when I originally designed that API, but I figured that if you didn't want to select the rows via the API, you would just not do so. Perhaps it should access a false parameter and alias that to match the api behaviour, although that could itself be a little confusing - which is why it is currently as is!

    Allan

This discussion has been closed.