Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Table Manager looks fantastic! There's just one extra feature that I'd love:
Would it be possible to allow the user to select a row, with a method for retrieving the data in the selected row?
Perhaps wrapping the text in each cell in html form tags to make them post back their ID value when clicked?
I'll have a delve through the code to see how possible this is, but in the meantime, any advice you could give would be great.
Thanks,
Chris
Comments
Comment #1
pobster CreditAttribution: pobster commentedHi, I'm not quite sure what you're asking? Do you mean like when you enable the 'admin' links which allow you to edit the row, but rather a button/ link which just displays that rows information?
Pobster
Comment #2
displaced80 CreditAttribution: displaced80 commentedOk -- I didn't describe that very well :)
Imagine you're a user viewing a tablemanager-generated table within a node. This node's content was generated by PHP script submitted as the body text.
Could tablemanager have a column containing a clickable widget (text hyperlink, button, etc) for each row which will mark that row as 'selected' - perhaps the row's background colour would change to indicate this.
Then, from the PHP code, could the values be retrieved from that selected row for further use?
I hope that makes sense! This request does sound rather 'pie-in-the-sky', and I'm certainly not expecting this feature to magically appear :) But your thoughts on its feasibility would be great.
Thanks,
Chris
Comment #3
pobster CreditAttribution: pobster commentedNo, no it's a fairly simple request, but well... The word 'reluctant' immediately springs to mind... You see, I wouldn't particularly want to implement something like this within the main code as well, the module is supposed to just manage tables - it isn't for webforms/ surveys - I *really* **really** wanted to keep it as simple as possible, after all I initially wrote it for my 65 year old Dad to enter stock in on his website (he can barely write his own emails, hence the simplicity)... I think adding functionality like this will over-complicate things, as you'll need to define a redirect page, write code for that page, any textboxes within the table will need to be validated for exploits, etc... I think something like this is great for a hack, but not for the general public.
Here's how I'd do it;
Create a new field type which is auto-filled in with the row ID (they're all individual) and invisible on the table-entry form.
You can then in tablemanager_display add to the switch statement for field types. Add one for your new entry, I'm simplifying this, so just lets say this is a simple button which links to a static page and passes the row ID as a POST variable.
You can then 'pick' up the POST variable on the next page.
Okay so this isn't exactly what you asked for, but it's a generalized answer on how I'd go about doing it. Unfortunately (for you anyway!) tablemanager version 2 makes it really easy to add new fieldtypes as they're 'pluggable' like CCK, the current version of Tablemanager is a MESS, mainly due to it being released doing one thing and then hacked to bits to add this and that functionality over the course of about a year and a half! This next version is obviously coded a lot better as the functionality is retained (and added to) from the offset, so it's been written without any hacky-ness, it's a way off a release yet though...
Pobster
Comment #4
pobster CreditAttribution: pobster commentedComment #5
pobster CreditAttribution: pobster commentedCleaning up issue queue...