Modify

Opened 7 years ago

Last modified 5 years ago

#12523 new enhancement

Field of Table Plugin - Ability to modify field type

Reported by: Jason Owned by: Cauly
Priority: normal Component: FieldOfTablePlugin
Severity: normal Keywords: fieldtype
Cc: Trac Release: 1.0

Description

I have the Field of Table plugin installed and it looks great. I looked around and didn't find anything about it, and was wondering if there is any way to change the type of each cell in the table. For example, instead of text, if we had a list of users that was a part of the User column, could we set that as a drop down list? See the table below for more of what I'm asking:

User Hostname time
drop down list text date/time picker

Is there anyway to do this? or is it already a feature that I just haven't found yet?

Attachments (0)

Change History (7)

comment:1 Changed 7 years ago by cauly@…

Hello jason,

I'm sorry there're no existing feature that supports a drop down list.

It's easy to implement a drop down list with given values but however I'm not sure how to get all existing users in trac system. If you don't need to get trac users in the drop down, maybe I could help you.

comment:2 Changed 7 years ago by Jason

Similar to how you specify the table_field.value with a list of column headers you want to use (in my example I used User, Hostname, time), I was thinking of being able to do something similar with a list of usernames to be able to populate the drop down list. In my head I think of it as you specify the initial header names (User, Hostname, time), then for each value created for that you get a new value field for each of those headers: User.value where you can populate the usernames, then Hostname you get hostname.value = text and time.value = date/time picker. Does that make sense? And would something like that be possible?

comment:3 Changed 5 years ago by figaro

Can you let us know whether the plugin AutocompleteUsersPlugin would work for you in this case?

comment:4 Changed 5 years ago by figaro

Keywords: FieldofTablePlugin Trac removed

comment:5 Changed 5 years ago by Cauly

Sorry for replying so late for this ticket.

Basically this plugin uses a very simple implementation. To support concepts like "field type" needs a full refactoring, which is quite a big effort.

And after refactoring it seems quite easy for me to support a drop down of user&list, but however while it is possible to support AutocompleteUsersPlugin, it's not a good way to include other plugin's javascript variable in this plugin. A better way is to ask AutocompleteUsersPlugin to provide some interface extensibility.

comment:6 Changed 5 years ago by Cauly

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:7 in reply to:  1 Changed 5 years ago by Ryan J Ollos

Replying to cauly@…:

... however I'm not sure how to get all existing users in trac system.

Available through Environment.get_known_users. Example: browser:tags/trac-1.2.2/trac/ticket/default_workflow.py@:551#L541.

I'll look at implementing #6444, but you'd still need to add the appropriate class to the column.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Cauly.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.