volosoft / jtable

A JQuery plugin to create AJAX based CRUD tables.
http://www.jtable.org
1.1k stars 505 forks source link

Would like to see many to many support #1267

Open abaile33 opened 10 years ago

abaile33 commented 10 years ago

Perhaps a new field option of many to many causing the table to jump to next level in json for child rows, skipping the many to many table between. Ex: {parent_name : mom, parent_to_child : [{child: {child_name : bob}}child: {child_name : jane]}. The parent_to_child field would get marked as many_to_many causing the table to use the child field values as table rows for each child instead of using the parent_to_child field values for the child rows.

misterparsons commented 10 years ago

That's totally within your control. jtable does not implement ANY parent child data relationships, it merely supports a child html table within a parent html table. You define the data relationship between the parent jtable and the child jtable within the $img.click function by calling appropriate "child" queries with suitable keys. to get a new dataset for the "child" jtable. The "child" query can be anything derived from your database using something in the parent record as a key.

So in your example, you might expand mom's record and get a list of bob and/or janes teachers.

Regards M