Categories | Question details Back To List | ||
Selecting a whole column for copy-pasting in professional edition dhtmlxGrid? We are thinking getting your professional edition dhtmlxGrid. We would like to know if there is a particular set of APIs available which would allow us to: Right-click on a column header and bring up a context menu with the option select column. This column selection should be similar to the mouse yellow dashed border copy-paste where CTRL-C and CTRL-P commands are recognised. Is this possible and how? Many thanks. Answer posted on Sep 06, 2007 15:56 There is no ready to use API for such scenario, but you can a) use dhtmlxMenu api to assign it to any HTML zone including grid headers. b) create selection by next command set grid._CreateSelection(0,0); grid._RedrawSelectionPos(grid.cells(first,index).cell,grid.cells(last,index).cell); grid._ShowSelection(); where first - id of first row in column last - id of last row in column index - index of column for which selection created Answer posted by Niran on Sep 07, 2007 18:05 Also, would this "column copy-paste" work in the case where all the data in the column had not be obtained yet - say, 10,000 records, with AJAX requests to fill in later when necessary? Thanks. Answer posted by Stanislav on Sep 07, 2007 19:20 This functionality copy data from available rows only, not loaded ( parsed ) rows will be skiped (actually block copy functionality was not designed to be used in smart rendering mode, so some side effects possible ) Answer posted on Sep 10, 2007 19:12 Would a possible solution to this problem be if we had a server side script that is called to fetch all the data for that particular column and store that retrieved data in the clipboard javascript object? btw, what are the clipboard objects/apis? Also, another issue I would like some information on is say we had another right click column option, for example, "autoincrement name column" where all the data in the first column gets an incremented number attached to the end to make the names unique. Would the dhtmlxDataProcessor be able to handle this updating on 1000rows at the server side even though we are displaying say 20 rows at a time? Also, can the dhtmlxDataProcessor be configured in such a way that any manipulated data is saved only when the user is ready and clicks on a explicit "Save" button? Your feedback is much appreciated so far...many thanks. Answer posted by Stanislav on Sep 11, 2007 11:23 >>Would a possible solution to this problem be if we had a server side script that is called to fetch all the data for that particular column and store that retrieved data in the clipboard javascript object? btw, what are the clipboard objects/apis? Yes, I think it can be solved in such wayClipboard can be accessed by val=grid.fromClipboard(); grid.toClipBoard(val); >>Would the dhtmlxDataProcessor be able to handle this updating on 1000rows at the server side even though we are displaying say 20 rows at a time? dataProcessor handle all updates, but if you not load all rows on client side, the not loaded rows can't be incremented in first place >>Also, can the dhtmlxDataProcessor be configured in such a way that any manipulated data is saved only when the user is ready and clicks on a explicit "Save" button? If you set update mode to dp.setUpdateMode("off") dataProcessor will not send data automatically; next instuction cause to send all modification in single AJAX call dp.setTransactionMode("POST",true); Answer posted by Niran on Sep 12, 2007 16:05 Hopefully, last question on this thread: One major criterion we have is speed of the application for large amounts of data manipulations. I would like to hear if u have any other suggested recommendations which you may have if we go ahead with you professional edition. Many thanks. Answer posted by Stanislav on Sep 13, 2007 19:19 >>If we have SmartRendering on and say we are displaying 20 rows of possible 500rows, would u suggest in your experience that it is better to have some temporary database objects which would store any of the unsaved column manipulations before the user clicks on the 'Save' button? The server side script would be using these temporary database objects. I don't think such complex approach is necessary, while in SRND mode grid can show only limited count of rows , it doesn't matter that it will show only 20 rows at time and lost changes when new set of rows show, all data changed on client server will preserved and available at any moment till page unloading, without relation which rows shown and which data retrieved from server side. You can get list of changed rows and their values it any moment of time, so it not necessary to have some temporary object on server side. |