How to set buttonCount for pager initialized via data-attributes

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    9 posts
    Member since:
    Jun 2014

    Posted 10 Nov 2014 Link to this post

    Hi,

    I've got a short question regarding MVVM, ListView and Pager:

    The template contains a ListView and a Pager, both initialized via data attributes:

    <div id="thumbnail-list" data-role="kendo.ui.ListView" data-bind="source:thumbs" data-template="template-thumbnails" data-source="{ 'pageSize': 52}"></div>
    <
    div id="pager" class="k-pager-wrap" data-role="pager" data-bind="source:thumbs, events: { change: onChange }" data-source="{ 'pageSize': 52}"></div>

    Now I want to change the "buttonCount", but not quite sure how to do this. I've looked at how it works via JS initialization, but does it also work with data-attributes?

    Trying to set it after initialization like this does not work:
    var pager = $("#pager").data("kendoPager");
    if(pager != null){  
      pager.options.buttonCount = 3;    
      pager.refresh();
    }

    Thanks in advance,
    Patrick
  2. Patrick
    Patrick avatar
    9 posts
    Member since:
    Jun 2014

    Posted 10 Nov 2014 in reply to Patrick Link to this post

    Found the solution.

    Using the "data-button-Count" solved the problem.

    Best regards,
    Patrick
  3. Kendo UI is VS 2017 Ready
Back to Top