ColReorder and Bootstrap modals
ColReorder and Bootstrap modals
rf1234
Posts: 3,021Questions: 88Answers: 421
in ColReorder
I am using quite a few data tables shown in Bootstrap 3 modals that are shown on custom button click.
This does not work with ColReorder enabled. On first click the table isn't loading. On second button click it does. Editor doesn't work at all.
Took me a while to figure out this was caused by colReorder. There was only one error message using Editor that indicated this.
Solution: Disable ColReorder for data tables in Bootstrap modals.
This discussion has been closed.
Replies
Are you able to give me a link to a page showing that issue please?
Thanks,
Allan
@allan, yes will do. I'll send you credentials etc. in a private message. This one was really hard to find, but I am fine with my solution: My data tables in Bootstrap modals are small so that ColReorder isn't really required for them.
This is weird: I am just trying to set up the test case for your, Allan. And now everything works like a charm.
There is a slight difference to my initial setup. Initially I had set colReorder to true during the setting of my data tables defaults. If I do this and have no additional specification for colReorder in the modal data table definition it does not work.
The difference to my "normal" data tables is mainly that the code of the modal data tables is only being executed on button click, i.e. it will be much later than the default setting code.
Now to set up the test case for you I did it differently: I set colReorder to true if the user is Allan Jardine in the individual data table definition which is being executed on button click. And now it works! So the problem seems to be associated with the fact that the modal data tables code is being executed much later than the default setting code.
This is my default setting code:
With this code colReorder does not work:
With this code colReorder works like a charm:
Will still send you the test case credentials but I will set it up so that it is like the initial case that does not work.
Could be a Javascript scope problem, couldn't it? The modal data table definition is in a function executed on button click while my "normal" data table definitions are of course not inside a function.
Sorry, can't set up the test case up for you because it would mean I need to show the problem to all of my users again which I cannot do. Sorry. But maybe the hints above are enough?!
Another reason might be the use of "retrieve"?! Just to make it a little easier for you here is a complete example. I changed my work around now to add one line of code to each of my modal data tables:
"colReorder: true"
Since the default setting for colReorder which is identical is being ignored for modal data tables this is required to make colReorder work.
Here is a complete example that works: