how to change ids of datepicker control dynamically and make it work?
I have 4 columns.开发者_StackOverflow All these columns have datepickers in top. I want to allow users to remove the column they wish and add a column again at will. for that, I just want the columns to be ordered.
So if the columns are ordered like : 1 2 3 4, and say, user deletes 2, I want to rename the remaining columns as 1 2 3.
But after I do that, if I select a date in column 2, column 3's dates are also being changed.
So, currently I am destroying the datepickers and resetting them in a loop. Its taking insane amount of time to do so.
How do we solve this ?
Why do you want to swap them?
I think after attaching the date pickers, they don't care what id
was originally used to select them, as the events, etc are attached to the DOM elements themselves.
I don't think you can swap them without unbinding them and rebinding all the events. If it is the positions you'd like to swap, I think that could be achieved through jQuery with help from CSS.
精彩评论