开发者

how to change ids of datepicker control dynamically and make it work?

开发者 https://www.devze.com 2023-01-26 01:23 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消