Hi everyone,
I am trying to create a good way to handle a many-to-many relationship that
has a type field associated in the relationship table.
Person <-> Role (with type field) <-> Company
I am working on the Person form, using a <hjq-input-many> on the role as
the object (accessible = true) on role. Basically:
<extend tag="form" for="Person">
<old-form merge>
<field-list:>
<roles-view:>
<hjq-input-many>
<item:>
<field-list fields="role_type,company">
<company-view:>
<select-one-or-new-dialog/>
</company-view:>
</field-list>
</item:>
</hjq-input-many>
</roles-view:>
</field-list:>
</old-form>
</extend>
This looks great! And, seems to work just fine with instances where the
role "row" already exists (i.e. update). Put if you click the "+" and add
a new role, then the dialog pops up and is not editable.
I think this is because I am getting too far from the intended use (deeper
in the model), and more specifically because it is expecting the role row
to exist...you can kind of see this if you look at the HTML that is created:
<button class="hjq-dialog-open-button"
onclick="hjq.dialog_opener.click(this, jQuery('#hjq-dialog-*-company*'));
return false;">
New
</button>
for a new row versus this for an update instance
<button class="hjq-dialog-open-button"
onclick="hjq.dialog_opener.click(this,
jQuery('#hjq-dialog-*role-73-company*'));
return false;">
New
</button>
Anyone done anything like this? Any better ways to edit a many-to-many
with a type field in the relationship table? Any way to fix the above?
Thanks!!
Mike
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/hobousers/-/oxuOEjtZDmEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.