I would like to get the WebDavURL property of an item int he listview using Anguilla for a GUI Extension.
I have the following code but WebDavURL is not returned:
selectedItem = selection.getItems()[0];
var item = $models.getItem(selectedItem);
var webDavUrl = item.getInfo().webDavUrl();
You'll have to actually load the webDavUrl... item.loadWebDavUrl(). You'll have to set an event handler though to notify once the WebDav URL has been loaded as its an asynchronous method. Here's a sample that includes loading and setting an event handler:
var item = $models.getItem(selectedItem),
webDavUrl = item.getWebDavUrl();
if (!webDavUrl) {
// WebDavUrl for cached item hasn't been loaded yet, so lets load it.
$evt.addEventHandler(item, "loadwebdavurl", function (event) {
webDavUrl = item.getWebDavUrl(); // also could do event.source.getWebDavUrl()
});
item.loadWebDavUrl();
}
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With