Replies: 4 comments 7 replies
-
Short answer... I have no idea hahaha, I didn't create this plugin (like many others), I simply copied it from SlickGrid which was in plain JS at the time and rewrote it in TypeScript. If it doesn't work the way you want, feel free to make changes. However I think that the goal was to make sure the cell doesn't have an open editor (so internally SlickGrid calls the slickgrid-universal/packages/common/src/core/slickGrid.ts Lines 5263 to 5268 in 9223338
Not exactly what you mean, maybe need more explanations on that. Side note, I changed my focus to another dependency used by the project. I have started rewriting excel-builder.js to TypeScript. The "why" is because the project is so old and is written with ancient technologies like So long story short (for me as well lol), I'm making good progress, I got it mostly all converted to TypeScript, dropped I'm going to rename the updated lib to The only other large change I want to do in the future would be the switch from |
Beta Was this translation helpful? Give feedback.
-
BTW, you can take a look at the original plugin for comparison. One thing to note is that SlickGrid never had any |
Beta Was this translation helpful? Give feedback.
-
the open editor situation makes sense as you described. but in case I navigated via arrow keys or marked the cell as part of others, so no active editor, it would also skip the formatter. I think I'll try to modify the condition and see if everything still works. I'll add a PR for that. thats great news about the excel plugin. dropping the need for cjs would be huge plus contributing changes/fixes to the TypeScript base would be way easier. with regards to temporal have you thought about using a polyfill in the meantime? https://www.npmjs.com/package/@js-temporal/polyfill |
Beta Was this translation helpful? Give feedback.
-
so while trying to fix this I had an issue. I can't really only check for But now I realized the function https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/extensions/slickCellExcelCopyManager.ts#L151 actually doesn't care about the cell alltogether and only ever copies row/cell 0,0. I can't really think of any reasoning why it's doing that so I'd assume this is just a dummy implementation that was kept around. I think what should be done instead is to pass the row/cell here (https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/extensions/slickCellExternalCopyManager.ts#L436) to here's whats currently happening: |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I've been tweaking my copy&paste feature where a couple of columns are foreign-key lookups.
That means I fetch data for the grid, which contains the master data, that references other tables for details. So some columns have a value being an id, wheras the label is a column from the references foreign key.
Master Data
Resolved members
Now the fictional column memberOf has a custom formatter, which looks up the label of the members lookup source and formats the output. Additionally there is a custom editor, which is a select box that receives a lazy datasource, and pre-selects the value based on the provided id.
So the resulting rendering of the grid would be
If I now select all cells, copy and paste them into Excel, I'll get the result
Zewa \t [email protected] \t 1
So I've seen that columns can be annotated with
exportWithFormatter
but still the output is the same. After digging into the code I found here that the setting is only respected if the grid isn't editable or the cell does not have a defined editor.Long story short, why is that defined this way?
Second question, would it perhaps be a good idea to add a global option that overrides the other two checks?
Beta Was this translation helpful? Give feedback.
All reactions