I have a grid with the selectable option sat to "multiple, cell". I use the change() event on the Grid that fires when selection changes. In this callback function, I can call this.select() to get a jQuery object/array of objects of the selected element(s). So I have something like:
Now, I could build something to copy this object's text content (or anything else, cause I have the jQuery object at hand) to the clipboard, but it's rather difficult to keep the table structure that I actually had in the table. How do I know which TD is the last in selection and is followed by a line break (new TR)? My selection was partial, so I can't use :last-child or similar since there are more TDs in this TR (see attached file).
Also, any way to stop the normal, in browser text selection when I have enabled selection of cells?
And finally: any tips on a nice copy-to-clipboard solution? It'd be nice to do without Flash if possible, and browser requirements are rather high (IE8+).
Thanks.
/Jacob
jQuery(td.k-state-selected, td.k-state-selected, td.k-state-focused, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected, td.k-state-selected)
Now, I could build something to copy this object's text content (or anything else, cause I have the jQuery object at hand) to the clipboard, but it's rather difficult to keep the table structure that I actually had in the table. How do I know which TD is the last in selection and is followed by a line break (new TR)? My selection was partial, so I can't use :last-child or similar since there are more TDs in this TR (see attached file).
Also, any way to stop the normal, in browser text selection when I have enabled selection of cells?
And finally: any tips on a nice copy-to-clipboard solution? It'd be nice to do without Flash if possible, and browser requirements are rather high (IE8+).
Thanks.
/Jacob