jsrender template: example 2

satya - 4/22/2014 10:09:20 AM

How I implemented a Folder widget


<div class="pagemenu1">
<p class="header">{{:folder_name}}</p>
{{for primaryLoop}}
<p><a href="/akc/display?url=DisplayNoteIMPURL&reportId={{:item_id}}&downerUserId={{:#parent.parent.data.folderowner}}">
{{:#index}}. {{:report_short_name}}
</a></p>
{{/for}}
</div>

<script>
function showManage(linkElement)
{
    var manageDiv = $(linkElement).closest("div.manage");
    var expandedManageDiv = manageDiv.siblings("div.manage_expanded");
    
    expandedManageDiv.show();
    manageDiv.hide();
    //return false;
}  
function hideManage(linkElement)
{
    var expandedManageDiv = $(linkElement).closest("div.manage_expanded");
    var manageDiv = expandedManageDiv.siblings("div.manage");
    
    expandedManageDiv.hide();
    manageDiv.show();
    //return false;
}  
</script>

<div class="manage">
<p>
<a href="javascript:void(0)" onClick="javascript:showManage(this)">Manage</a>
</p>
</div>

<div class="manage_expanded" style="display:none">
<p>
<a href="javascript:void(0)" onClick="hideManage(this)">Hide</a>
<a href="/akc/display?url=NotesIMPTitlesURL&downerUserId={{:downeruserid}}&folderId={{:folderid}}&order_by_format=news&folderOwner={{:folderowner}}">Folder</a>
<a href="/akc/display?url=NotesIMPTitlesURL&downerUserId={{:downeruserid}}&folderId={{:folderid}}&order_by_format=news&folderOwner={{:folderowner}}&aspire_output_format=embedded-xml">xml</a>
<a href="/akc/display?url=DisplayNoteBodyURL&ownerUserId=satya&reportId=4309">template</a>
</p>
</div>