Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Sounds interesting, but why do you want to do this? There may be an easier way…

    Thread Starter dwightlathan77

    (@dwightlathan77)

    I brought it up because I thought it might be useful for mapping groups of participants who are related by family or group. I am also interested in tracking who inspired others to join an organization and who may be mentoring them.

    In my specific case I have parents and minors both qualified to volunteer who I would like to associate together from within the module, but have resorted to looking up a parent’s unique id from one browser tab and copying it into a relation field stored in the Participants Database.

    Plugin Author xnau webdesign

    (@xnau)

    I understand. With something like this it’s really all about the user interface, answering the question “what does the user do to set up the relation?” The easier it is for the user, usually the more complex it is on the code side. For instance, probably the easiest way for the user to set up the relation is for them to start typing in the name of the related person, with the code suggesting a match as soon as it has enough info to identify it. That would require a fairly sophisticated piece of Javascript to get that done.

    A much simpler approach would be to offer an alphabetized list of all the last names (or first names) in a dropdown, which once selected, offers a dropdown of all the matching first names to complete the record…again you’d need some Javascript to populate the second dropdown. Simpler still would be a massive dropdown that contained all the names…not too bad until the list gets to be near 100 records. You wouldn’t need any Javascript for that, just a special template that populated the dropdown when the form was displayed.

    It’s also possible to post-process the submission: the user just types in the full name of the related person, then when the record is submitted, some custom code tries to find a match and adds the record ID once it finds it.

    Of course it all requires custom code. If I were to consider adding a feature like this to the plugin, I’d have to come up with a generalized approach that would be useful to anybody that wanted to use the feature for any of kind of relation.

    Thread Starter dwightlathan77

    (@dwightlathan77)

    Yes, I was thinking the same thing, but thought it would be a good feature to mention. One I may be thinking myself out of.

    The need to have a generalized approach with any relation does make it much more difficult to implement. A solution might be to provide a multi-value Relation type Form Element that defines 2 selects: one for the participant list and another for the relation. I suppose you would also need to decide if you wanted data integrity, and I wonder if the typical administrator would be able to generate meaningful reports based on the fields. The typical use may be limited to hyperlinks to the related Participants, and probably one-way links at that due to processing needs.

    When I get to the point I need to implement this feature I plan on using your first and third suggestion by using ajax to populate a multi-value select with the relation’s id and name, then overlay it with a jquery autocomplete. That way I can leave your plugin unmodified.

    Plugin Author xnau webdesign

    (@xnau)

    Sounds like you know your way around Javascript. It’s definitely the best way to go.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Participant relationhsips’ is closed to new replies.