Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8877

2 Models, 1 Control (HTMLView)

$
0
0

Hi all

 

I think this is a not-so-uncommon use case:

 

I'm trying to bind a model (1) to a Select-Control in order to provide a selection of values.

At the same time, I'm binding other controls to a common model (2) which I use to pass data to another view.

 

So I'd like to bind the selected value of that select control also to that common model (2), but I'm unable to find out how to do that.

 

Think of a list of country names in one model (static json file) and the effectively selected item as part of the other model (among other user entered data).

 

 

My model (1) contains Key/Value pairs, where I want to use the keys as ID and the name as text in the select items. I've tried custom-data, but so far this aggregation is empty when I read it.

 

 

Also: How do I set the default selected item/id using HTMLView? data-selected-item? data-selectedItem?

 

Ideas anyone?

 

Regards

Phil


Viewing all articles
Browse latest Browse all 8877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>