I am now creating selectable and draggable elements of a table. Here is JsFiddle Link (please test as vertically select). The first time selection is fine but when selecting second time , selection may look like below image
I noticed that , after selection the first-time , I click on the header of my table and this may fix the second-time selection. So, I decided to click header of the table by programatically after finished every selection as
function mouseReleased(e) {
jQuery(".scheduler .header")[0].click();
......
}
and checking for sure click event as
jQuery(".scheduler .header").click(function(e) {
console.log("Header Clicked !!");
});
Why this doesn't work ? Has differenece between programatically click and manual click on element ?
bonus question : What's wrong with my script or css for achieve selecting columns of table fine ?