I'm trying to retrieve the webdav url of a component using Anguilla but i see the value to be retrieved as undefined. As suggested by Nuno i'm using
var x = frames[0].$models.getItem(“tcm:1-123”)
x.loadWebDavUrl()
x.getWebDavUrl()
Not only this function but rest all are also resulting as undefined.
I'm using the below code in the js file as suggested in stackoverflow question http://stackoverflow.com/questions/14082844/getting-the-webdavurl-from-tridion-anguilla-in-the-list-viewhttps://stackoverflow.com/questions/14082844/getting-the-webdavurl-from-tridion-anguilla-in-the-list-view
Extensions.CopyUri.prototype._execute = function CopyUri$_execute(selection) {
selectedItem = selection.getItems()[0];
// prompt("Copy the Item ID using Ctrl/Cmd + C:", selection.getItems()[0]);
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();
}
prompt("Webdav Url is ",webDavUrl);
alert(webDavUrl);
}