Version 1.1
A customer have some options which are related and contains constrains.
Say:
You can only combine the car
vw
with one color
green
.
This is a simple implementation of such rules, using only
jQuery
.
Version 1.1:
Small changes after 1st live implementation.
You can actually have more elements bound to a
data-type
!
The model only needs to define the constrains seen from one of the options:
I only "tell" which colors exists for which car. Code will "turn constrains around" and generate the "color to car" constrains.
Twodata-attributeson theselectelement are used to enforce constrains:
data-type: The type of constrain (like car )
data-bound: Which data-type is it bound to? (like color )