Contents

setPropertyPath

Sets the value associated with a property path.

Declaration

void setPropertyPath(
    in String path, 
    in Object value
);

Parameters

  • path:

    The dot-separated sequence of properties from the receiver. The path can contain array indexers. For example, items[0].title refers to the title property stored in index location 0 in the items array.

  • value:

    An object associated with the property path.

Discussion

Set the property path to associate the data item objects contained in the value parameter with a section element. Listing 1 shows an example of data item objects contained in the newItems object added to the section that binds the images path; for example <section binding="items:{images};" />.

let section = shelf.getElementsByTagName("section").item(0)section.dataItem = new DataItem()

let newItems = results.map((result) => {
    let objectItem = new DataItem(result.type, result.ID);
    objectItem.url = result.url;
    return objectItem;
});

section.dataItem.setPropertyPath("images", newItems)

See Also

Working with Property Paths