开发者

How can I copy table cells in excel style using jQuery?

开发者 https://www.devze.com 2023-02-22 07:30 出处:网络
excel has a nice feature which allow that cells to by copied by a mouse drag and drop.The same functionality is offered by Google spreadsheet.

excel has a nice feature which allow that cells to by copied by a mouse drag and drop.The same functionality is offered by Google spreadsheet.

I can't grasp the Googles JavaScript code and开发者_JAVA百科 figure out how they've done it. Is this functionality something that the jQuery framework provides?

I would appreciate any information: jQuery keywords/functions/plugin, pseudocode, link etc.


I've never done such thing or know any plugins but I have some ideas.

  • First of all to copy something to clipboard you need javascript & flash combination (for ctrl+c ctrl+v combinations)
  • To drag and drop cells, I'd do it like this. Draw lots of rectangles to screen. By using jQuery mousedown and mouseup events calculate first clicked and last upped rectangle coordinates and highlight all rectangles between these two. If mouse is on edges of these selected boxes change mouse icon. On mousedown start dragging. Then when mouseup, find new rectangle calculate the other rectangles based on the number of original ones then replace them.
0

精彩评论

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