1)Need to put this link in page
<iframe id="GBTpreviewframe" width="100%" height="800px"></iframe>
//getting document url from document library//
function geturl()
{
$.ajax({
url: siteurl + "/_api/web/lists/getbytitle('" + Listname+ "')/items?$select=EncodedAbsUrl&$expand=File",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
success(data.d.results);
},
error: function (data) {
debugger;
failure(data);
}
});
}
function GBTgetListItemsForApproverssuccess(arrayname)
{
htmltable+= '<a onclick=GBTDocumentpreview("'+arrayname.EncodedAbsUrl+'")></a>;
}
function GBTDocumentpreview(url)
{
document.getElementById("GBTpreviewframe").setAttribute("src", url);
}
No comments:
Post a Comment