var aryPortalList = []; function getPortalList() { var wP = window.location.protocol; var wH = window.location.host; var wPath = "ibi_apps/rs/ibfs/BIP/Portals?IBIRS_action=get"; //http://webfocusclidev:8080/ibi_apps/rs/ibfs/BIP/Portals?IBIRS_action=get; var webfocusAPI = wP + "//" + wH + "/" + wPath; $.ajax({ type: "GET", async: false, url: webfocusAPI, dataType: 'xml', success: function(xml) { $(xml).find('children').children().each(function() { var portal = { Name: $(this).attr('bipName'), Link: "/ibi_apps/bip/portal" + $(this).attr('bipPath'), IconLink: "/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&IBFS_path=" + $(this).attr('bipIconPath') }; //var portal console.log("portal.name=" + portal.Name); if (portal.Name != "GlobalBI") aryPortalList.push(portal); }); //each console.log("Portals in List = " + aryPortalList.length); } //success function }); //ajax } function displayPortalList_Icon() { if (aryPortalList.length == 0) { var hTxt = "<p>You do not have access to any portals</p>"; $("#portallist").append(hTxt); } else { var bRowAdded = false; var hTbl=$("<table id='tbl_portallist'></table>"); var row = $('<tr></tr>').addClass('ingrPL_row'); console.log("Portals in List = " + aryPortalList.length); for(var j=0; j < aryPortalList.length; j++) { var cell = $("<td align = 'center'></td>"); var hTxt = $("<p>" + aryPortalList[j].Name + "</p>"); var hLink = $("<a>").attr({"href": aryPortalList[j].Link, "target": "_blank"}); var img = $("<img>").attr("src", aryPortalList[j].IconLink); img.width("100px"); img.height("100px"); console.log("hTxt=" + hTxt); hLink.append(img); cell.append(hTxt); cell.append(hLink); row.append(cell); bRowAdded = false; if ((j+1) % 4 == 0) { hTbl.append(row); bRowAdded = true; var row = $('<tr></tr>').addClass('ingrPL_row'); } } if (!bRowAdded) { hTbl.append(row); } $("#portallist").html(hTbl); } } function displayPortalList_List() { if (aryPortalList.length == 0) { var hTxt = "<p>You do not have access to any portals</p>"; $("#portallist").append(hTxt); } else { var bRowAdded = false; var hTbl=$("<table id='tbl_portallist'></table>"); console.log("Portals in List = " + aryPortalList.length); for(var j=0; j < aryPortalList.length; j++) { var row = $('<tr></tr>').addClass('ingrPL_row'); var cell = $("<td align = 'center'></td>"); var hTxt = $("<p>" + aryPortalList[j].Name + "</p>"); var hLink = $("<a>").attr({"href": aryPortalList[j].Link, "target": "_blank"}); console.log("hTxt=" + hTxt); hLink.append(hTxt); cell.append(hLink); row.append(cell); hTbl.append(row); } $("#portallist").html(hTbl); console.log("portal.name=" + portal.Name); } }
table { border-spacing: 10px; border-collapse: separate; }
td { padding: 10px; }
<table cellspacing="1" cellpadding="1">
quote:var cell = $("<td align = 'center'></td>");
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | ||
WebFOCUS App Studio 8.2.06 standalone on Windows 10 |
quote:cell.append(hTxt);
cell.append(hLink);
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | ||
WebFOCUS App Studio 8.2.06 standalone on Windows 10 |
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | ||
WebFOCUS App Studio 8.2.06 standalone on Windows 10 |