When I use gridToClipboard(), the rowIds of each row show up (in excel) as the first column values although they are not displayed on the grid. How can I make it so that the rowId values do not show up in the clipboard and look exactly like the grid? Also, since the values are messed up the headers do not match the values when the clipboard data is pasted.
>>When I use gridToClipboard(), the rowIds of each row show up (in excel) as the first column values although they are not displayed on the grid. How can I make it so that the rowId values do not show up in the clipboard and look exactly like the grid?
gridToClipboard() copy to clipboard all grid values including hidden columns. If you have hidden column in your grid you can prevent coping them to the clipboard using method setSerializableColumns(list) where list - list of true/false values separated by comma, if list empty then all fields will be serialized.
>>Also, since the values are messed up the headers do not match the values when the clipboard data is pasted.
gridToClipboard() copy to clipboard all grid rows in such order like them present in the grid. This method can’t copy to clipboard grid’s header
I have the following xml:
A
B
C
D
E
F
G
H
I
J
I call grid.load(filename.xml, xml) which puts the xml into the grid. When
I display the grid the 1 and 2 do not show up and when I call grid.getColumnsNum()
it returns 5. But when I do grid.copyToClipboard() there are 6 columns with the
1 and 2 in the first column. I never “hid” the 1 and 2 in the grid; they just never
showed up and it seems from getColumnsNum() that the 1 and 2 values are not in the
grid since the size is 5. When I try to hide the 1 and 2 using
setSerializableColumns(false, true, true, true, true, true) it still displays the
1 and 2 and hides the values of the first column (A and F do not show up).
Do you mean this column (please see attachment)?
If yes - this is just row numeration in the Excell.
If no - please provide us any kind of sample where we can reproduce this issue
No, the first column. I am running searchChava.html
eventHandlersChava.js.zip (3.26 KB)
grid.xml.zip (336 Bytes)
searchChava.html.zip (1.92 KB)
Add following code to the grid init:
mygrid.enableCSVAutoID(true);
After that gridToClipboard() method will not copy grid’s ids to the clipboard.