gyrocode / jquery-datatables-checkboxes

Checkboxes is an extension for the jQuery DataTables library that provides universal solution for working with checkboxes in a table.
https://www.gyrocode.com/projects/jquery-datatables-checkboxes/
MIT License
150 stars 61 forks source link

Question about stateSave and possible bug. #122

Closed lenamtl closed 4 years ago

lenamtl commented 4 years ago

Hi,

I'm doing some tests and find out that even if checkboxes stateSave if set to false it get saved.

It seems that checkboxes stateSave is saving (empty) even if set to false but not always.

How to reproduce: have the checkboxes setting stateSave set to false

"checkboxes": {
            "selectRow": true,
            "stateSave": false, 
}

load the page, the checkbox settings won't be saved in the statesave so it will end something like this "naruto":"kurama"}

reload the page now we can see the checkbox[] (sometimes it may appear only after a few refresh) not sure why.

"naruto":"kurama","checkboxes":[]}

Is this supposed to appear even if empty? Why it's appearing only on reload, not on page load and/or why it appear if set to false?

mpryvkin commented 4 years ago

When checkboxes.stateSave option is set to false, empty checkboxes array should not appear in the state array, that's a bug. Thanks for reporting, I will have it corrected.