Select - optgroup support #1133

Open
wants to merge 3 commits into from

6 participants

@lordbron

In case you like them both and want an easy way to pull 'em both in.

lordbron added some commits Feb 15, 2013
@lordbron lordbron Option element conversion to contentController objects now honor text…
…PropertyPath and valuePropertyPaths, if available

select.reel honors the valuePropertyPath and textPropertyPath when converting a passed in contentController to <option> tags, but does not honor the reverse. If an <option> tag is present, it doesn't convert value and text values into corresponding valuePropertyPath and textPropertyPath properties on the generated objects.

This fixes that by using the valuePropertyPath ad textPropertyPath values when present and defaulting to "value" and "text" when they're not present.

Signed-off-by: Tom Ortega <tom.ortega@gmail.com>
bfb94ff
@lordbron lordbron optgroup nodes no longer ignored when reading in from markup
select.reel ignores optgroup when creating objects to stash in the contentController it creates to stash the values; This results in the groups disappearing in the drop down.

This fixes that by creating introducing a groupPropertyPath property and maintaining an offset value to use when calculating selected indexes of selected options.

Signed-off-by: Tom Ortega <tom.ortega@gmail.com>
566b4dd
@lordbron

I have a minor change to 1132, i'll update if you decide this is something you want.

@Stuk
MontageJS member

You should be able to just push the new commit to the same branch and it will get added to this pull request

@lordbron lordbron when existing options have no group labels
This fix is for when existing options have no 'groupLabel' nor groupPropertyPath on them.

This drops it back out of a group and back into regular option tags.

Signed-off-by: Tom Ortega <tom.ortega@gmail.com>
1a4df21
@lordbron

Awesome, thanks for helping the Pull n00b. :)

@francoisfrisch
MontageJS member

Closed #1131 and #1132

@francoisfrisch
MontageJS member

I need to add some cases to the tests before merging this.

/montage/test/ui/select-input-spec.js
/montage/test/ui/select-input-test/select-input-test.js
/montage/test/ui/select-input-test/select-input-test.html

@kriskowal
MontageJS member

Assigning to @francoisfrisch

@rayshan rayshan changed the title from Select optgroup support to Select - optgroup support Feb 20, 2015
@francoisfrisch francoisfrisch was unassigned by rayshan Feb 20, 2015
@thibaultzanini

@lordbron Can you please update this PR with the latest version of Montage.

@thibaultzanini thibaultzanini self-assigned this Feb 20, 2015
@rayshan rayshan added the wip label Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment