← Back to team overview

uonedb-qt team mailing list archive

Re: Referencing Document properties other than the just content text

 

On 03/07/2013 12:25 PM, Christian Dywan wrote:
On 2013-03-07 12:20, Kevin Wright wrote:
On 03/07/2013 12:18 PM, Christian Dywan wrote:
On 2013-03-07 10:46, Kevin Wright wrote:
For example, I want to make a ListView that contains the JSON string's
left side values (e.g. 'hello', hello2'), not the right side values.
You can access the keys like this, with standard Javascript:

Object.keys (contents)

for (var i in contents) contents[i]


Perfect. That is exactly what I was after.

Is this documented somewhere? Is it inherited from the Qt framework
itself or is it U1Db specific?
It's standard Javascript. The exact same syntax works in a webpage. This
is one benefit of sharing the Javascript implementation between QML and
WebKit.


We should remember to mention this somewhere so that those who are not aware will know what they have access to. I will add it into the tutorial.

Kevin




References