javascript - sharepoint 2013 Control Display Template : how to know how many items we'll get -
javascript - sharepoint 2013 Control Display Template : how to know how many items we'll get -
what want : custom menu on home page. display 4 images (and links) (coming custom link application) in square. (like @ every edge, couple image/link) not simple list (see :
myimage1.jpg mylink1 myimage2.jpg mylink2 myimage3.jpg mylink3 myimage4.jpg mylink4 )what have :
so, i've made custom link application contains several columns url, notes, imageurl.
on home, i've made webpart of category "report de contenu" -which should content report in english, guess- , component "contentsearch".
this webpart displayed custom command template -which re-create of control_list.html- , custom item template -which re-create of item_picture3lines.html .
what question : in control_list.html, in js, have :
var listrenderrenderwrapper = function(itemrenderresult, inctx, tpl, i) { var istr = []; istr.push('<li>'); istr.push(itemrenderresult); istr.push('</li>'); homecoming istr.join(''); }
this renders every item li, special displaying (defined in item_picture3lines.html) render these items in 2x2 table. like
<table> <tr> <td id=myitem1> <!-- content, displayed item display template --> </td> <td id=myitem2> <!-- content, displayed item display template --> </td> </tr> <tr> <td id=myitem3> <!-- content, displayed item display template --> </td> <td id=myitem4> <!-- content, displayed item display template --> </td> </tr> </table>
i know table ugly etc..
my question is.. how can know number of items displyed in command display template determine whether have end , open new one?
thanks lot, i'm new beginner in sharepoint, please kind! :)
your items (from command template) here
ctx.listdata.resulttables[0].resultrows
the number of items displayed is
ctx.listdata.resulttables[0].resultrows.length
javascript html sharepoint sharepoint-2013 display-templates
Comments
Post a Comment