Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Limit results in a n:n pivot table based on value 10 Aug 2016 11:48 #14413

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
I have a table called

table1

and another two tables called

regions,
territories


territories all have a FK of region (i.e territories belong to a region)

Table1 has two cross reference tables

table1 - regions (n:n)
table1 - territories (n:)


and using the pivot method built into J-Cook builder by default

I want to make it so that a person chooses REGIONS first when completing table1 (multiselect, entries go into table1region XRef table), but then in the next field, rather than being able to multselect ALL TERRITORIES, they are only presented with those that belong to any selected regions.

I can obviously fire an auto save when a user adds regions, but quite sure what model to alter to build in the complex join for the territories XRef

Any advise greatly appreciated
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

Last edit: by MorganL.
  • Page:
  • 1
Time to create page: 0.067 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started