This is a migrated thread and some comments may be shown as answers.

How can I remove "items per page" Label using PageSizes

1 Answer 684 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 29 Aug 2012, 09:09 AM

How can I remove "items per page" Label using PageSizes?

@(Html.Kendo().Grid<Model>(.Name("Grid")
 .Columns(columns =>
 {
  columns.Bound(p => p.DataId).Visible(false);
  columns.Bound(p => p.Data2).Width(200).Title("Data2");
  columns.Bound(p => p.Data3).Width(200).Title("Data3");
  columns.Bound(p => p.Data4).Width(100).Title("Data4");
  columns.Bound(p => p.IsTrue).Width(50)
       .HtmlAttributes(new {style = "text-align:center"})
       .ClientTemplate("<input type='checkbox' disabled='disabled' name='Discontinued' <#= IsTrue? \"checked='checked'\" : \"\" #> ").Title("IsTrue");
 })
 .Pageable(paging => paging
      .Input(false)
      .Numeric(true)
      .Info(false)
      .PreviousNext(true)
      .PageSizes(new int[]{25, 50,100})
      .Refresh(false)
   )
   
 .DataSource(dataBinding => dataBinding.Ajax().PageSize(25).Read("GridData", "Grid", new { someId = Model.SomeId }))
 .Resizable(resize => resize.Columns(true)).Scrollable()

)

1 Answer, 1 is accepted

Sort by
1
Justin
Top achievements
Rank 1
answered on 22 Oct 2012, 08:38 PM
This gets kind of tricky.

You will have to do this via jQuery.

Basically the page size drop down shares the same span as the text to the left of it. Because of this, you can't simply remove just that class.

Instead, do something similar to:

    // Removes default text near page size.
    $('.k-pager-sizes')
        .contents()
        .filter(function () {
            return this.nodeType === 3;
        }).remove();
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Justin
Top achievements
Rank 1
Share this question
or