Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow fill in choice? #20

Closed
leolorenzoluis opened this issue May 19, 2016 · 1 comment
Closed

Allow fill in choice? #20

leolorenzoluis opened this issue May 19, 2016 · 1 comment

Comments

@leolorenzoluis
Copy link

leolorenzoluis commented May 19, 2016

How to implement allow fill in choice where user can specify a value like SharePoint?

I can see under setupKoVar that it is setting koObj._isFillInChoice but I don't see any other usages of it?

My idea is that when the modelValue is populated, I want to set a field for that otherOption to be shown in the template which I have done. At a first look I am thinking of comparing this.modelValue and this.options, and whatever is not in the list options, then set that one as the otherOption field.

@jbonfardeci
Copy link
Owner

This feature is on the TODO list. It hasn’t yet been implemented due to level of complexity for the time being.

You can work around by created a text column ‘MyFieldNameOther’. If the selected option is ‘Other’, display the ‘MyFieldNameOther’ field, requiring input.

Example:

  1. You have a SP choice field named ‘Language’; Include an option for “Other"
  2. Set up a second SP text field, ‘LanguageOther’

Markup:

<so-select-field params=“val: Language, caption: ‘—Select an Language--’, required: true"></so-select-field>

<!— ko if: Language() == ‘Other' —>
    <so-text-field params=“val: LanguageOther, required: true"></so-text-field>
<!— /ko —>

There are other ways to accomplish the same thing such as ‘pushing’ the new option to Language._options -

vm.Language._options().push(’some new option’);
vm.Language._options.valueHasMutated(); // let Knockout know to update the display options

On May 19, 2016, at 1:09 PM, leolorenzoluis notifications@github.com wrote:

How to implement allow fill in choice where user can specify a value like SharePoint?

I can see under setupKoVar that it is setting koObj._isFillInChoice but I don't see any other usages of it?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants