Closed (fixed)
Project:
TableField
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 Jul 2012 at 07:29 UTC
Updated:
17 Dec 2024 at 19:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kevin hankens commentedThat is a great idea. I don't have time to do it personally, but I'd love to see a patch. Perhaps there could be an #ajax form similar to the rebuild button where it would take a csv-type of string and rebuild the tablefield widget with those values.
Comment #2
sylvaticus commentedHello, I would be interested as well.... unfortunatly my users are likely to have no idea on what a csv file is, but they may be able to do a copy/paste ;-)
Comment #3
lunazoid commentedHad an instance where the ability to paste the table data would make for a better experience for my client, so I threw together a quick patch to allow it. The column separator defaults to the TAB character (since this is what data copied from a spreadsheet will have) but can be changed to any other character.
In hindsight, maybe this functionality should be a separate module and use a hook_form_alter...
Comment #4
lunazoid commentedComment #5
jenlamptonI really like this feature, it's something my editors will appreciate. I've taken a stab at re-working the patch. There's a little general cleanup in here, but the only significant change is that I removed the "Other" textfield for the delimiter option, since I'd guess the main use-cases here are for tab and comma.
Comment #6
jenlamptonI've been using this patch in production and I found a few gotchas with the table not being resized correctly after paste. Ive got a fixed up version and will supply a new patch shortly. Marking as NW for now.
Comment #7
jenlamptonThis one pastes data and resizes the tablefield appropriately.
Comment #9
jenlamptonThanks so much @lunazoid! this feature will be in the next release of tablefield :)
Comment #11
lolandese commentedComment #12
matthieu_collet commentedhello
I'm interested in this functionnality on Drupal 8 version of tablefield, is there any planning on it ?
is somebody working on it ?
it's too complex to make it myself :(
thank you
Comment #13
davidiio commentedHi,
We needed this to work with D8 so I made the following changes in tablefield based on patch #7.
It would be nice if someone could revie this patch because it works for what I tried to achieve but I am not sure it is every use case proof.
Thanks
Comment #14
lolandese commentedComment #15
lolandese commentedPatch fails to apply. Try creating it with
git diff.Also at https://dispatcher.drupalci.org/job/drupal8_contrib_patches/19694/console:
Comment #16
matthieu_collet commentedthe test I added was an error, it worked, i don't know how to remove it
davidiio created it with
git diffComment #17
douggreen commentedUpdated patch mostly just fixes the diff so it applies cleanly, but also adjust some minor coding standards.
Comment #18
Munavijayalakshmi commentedi am working in this issue.
Comment #19
Munavijayalakshmi commentedComment #20
Munavijayalakshmi commentedComment #21
erutan commented#17 applies cleanly to 2.4 and works great.
While manual entry would work for very small bits of info, and having the file uploads is great for more complex use cases, in ours we need to add in data produced by another program - copy and pasting is a lot simpler than generating a file and then attaching it. I'd recommend this get patched in. :)
Comment #23
erutan commentedFix formatting in patch on permissions.yml to match earlier code cleanup so it applies to dev, applied to fork.
Comment #24
erutan commentedTests give the following new errors:
Drupal.Commenting.FunctionComment.ParamMissingDefinition at /builds/project/tablefield/web/modules/custom/tablefield/src/Element/Tablefield.php (485:3)
Drupal.Commenting.FunctionComment.ParamNameNoMatch at /builds/project/tablefield/web/modules/custom/tablefield/src/Element/Tablefield.php (488:6)
Comment #26
erutan commentedParams were copy-pasted from elsewhere in the document before.
Comment #27
liam morlandShould this be cherry-picked onto branch 3.0.x?
Comment #28
erutan commentedIt's new functionality, but it's just an extra option on top of existing ones (and is very useful). It should be in both branches.