I'm working with bootstrap table inside of jquery dialog and having problems with closing dialog and freeing memory. Let me show on demo code:
Method 1: jsFIDDLE Here is the code with two buttons inside dialog content which I use to save or cancel. They are coded with $.click() (not by dialog). To see the problem fallow 4 steps:
- Click first checkbox and accept date
- Do the same for the second checkbox
- Uncheck both (date field is empty in both rows)
- Check again one checkbox and accept date
You will notice now that the date was added into both fields of each row even if didn't click the second one. When I play more like this I can even uncheck both checkboxes with one click.
Method 2: jsFIDDLE The same idea, but I use buttons defined in jquery dialog and if you do the same steps from above, you won't notice the problem - it works just fine.
Question: I need to use the first method for my own purpose, but what to do to fix this memory problem?
You have a scope problem in your code; Please try this updated Fidle
See fidle for full code