Declined
Last Updated: 20 Aug 2021 10:32 by ADMIN
atb00ker
Created on: 14 Aug 2021 20:15
Category: Kendo UI for jQuery
Type: Bug Report
0
`alwaysVIsible` option not working with external DataSource

Hi,

 

The `alwaysVisible` option is ignored when we have an external DataSource.

Consider the following code:

 

```

var dataSource = new kendo.data.DataSource({
   pageSize: 2,
   data: [
       { name: "Jane Doe", age: 30 },
       { name: "John Doe", age: 33 }
   ]
});

$("#grid").kendoGrid({
   columns: [
       { field: "name" },
       { field: "age" }
   ],
});
var grid = $("#grid").data("kendoGrid");

grid.setDataSource(dataSource);

grid.setOptions({
   pageable: {
       alwaysVisible: false
   }
});

```

Here, since the `pageSize=2` and we have `2` records; I don't expect to see not the pagination and other pager options after `alwaysVisible` is set to `false`.
However, I do see them since `alwaysVisible` is completely ignored.

When I move the datasource back inside the `$("#grid").kendoGrid({})` everything works as expected.

Please let me know if this is an bug or I have mistaken in understanding something about the options.

Thanks,

Ajay

1 comment
ADMIN
Martin
Posted on: 20 Aug 2021 10:32

Hello, Ajay,

The alwaysVisible option is not being ignored in this case. As described in our documentation, if the items are equal or greater than the pageSize value, then the pager will be shown. If the items are less than the pageSize, then it will be hidden.

I hope that clears the matter. Let me know if you have any further questions.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.