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

Initial label for remote #33

Open
vanderlee opened this issue Jul 20, 2017 · 2 comments
Open

Initial label for remote #33

vanderlee opened this issue Jul 20, 2017 · 2 comments

Comments

@vanderlee
Copy link

When using a remote source, the initial value does not display the labelProp value.

For example, this slightly modified demo with initial value 3 for the remoteHandler:
http://jsfiddle.net/bvphzjvc/

Is it possible to call the source with the full value or perhaps some other method/trick to set the initial label?

@rniemeyer
Copy link
Owner

@vanderlee - If you know the label/value already, then you could set it directly:

this.remoteValue = ko.observable( { test: "initial-value", val: 3 } ); in the sample.

However, this would have to be the actual value until someone changed it. So, if a user did not make a change, then you would have to have code that checked if the value was an object rather than a number and grabbed the val (in this case).

I could see a change to this lib to look at an object provided in the dataValue option to try to determine the initial label value.

@BHare1985
Copy link

I have this same issue. I think a change to the lib would be useful

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

3 participants