Toggling DataTable columns with a separate widget

Actually I missed that you are passing the columns arg to the CustomJS, the probably ought to be sufficient, so it may just be a protocol issue. You could still try my other suggestions, it’s possible the references specifically in CustomJS are not good enough for some reason, but a second hidden table would be. But you could file a bug report issue for this as well.