- How to use ObservableDictionary.
When tried to insert key:value pairs to dict, there is only one key and one value in dict.
this.myData(new nx.data.ObservableDictionary());
this.myData().setItem({id: 1, value:'key_1'}, {id: 10, value: 'value_1'});
this.myData().setItem({id: 2, value:'key_2'}, {id: 10, value: 'value_2'});
this.myData().setItem({id: 3, value:'key_3'}, {id: 10, value: 'value_3'});
this.myData().setItem({id: 4, value:'key_4'}, {id: 10, value: 'value_4'});
and output:
this.myData().keys().toArray()
[Object
id: 1
value: "key_1"
__proto__: Object]
this.myData().values().toArray()
[Object
id: 10
value: "value_4"
__proto__: Object]
only string or number keys works
Second:
How to generate view from dictionary data. Got the data model in following format:
key: {id, name}, value: [ {id, mode, ...}, {id, mode, ...}, ...]
I need to show this data in following format
- key1
- id, mode, ...
- id, mode, ...
- ...
- key2
- id, mode, ...
- id, mode, ...
- ...
- ...
Comments
0 comments
Please sign in to leave a comment.