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

(BUG?) Dynamically show/hide Pager based on $.ajax success result

1 Answer 78 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 11 Apr 2013, 03:06 AM
Hi,

In the spirit of the XY Problem, I have an immediate problem I need solving, and also a "How should this be done?" question.

I want to modify the "Basic usage" ListView Demo example [1].  I want to dynamically show or hide the pager based on whether or not there are actually pages to view.  I don't even think the solution I came up with will work in all situations, as it seems the pager doesn't refresh after the ajax success handler gets called.

I put together a JSFiddle that is the modification I want.  It works with jQuery 1.7.2 & 1.8.3 but bombs out with jQuery 1.9.1. My public JSFiddle is currently pointing to jQuery 1.7.2.  Below is the Google Chrome Version 25.0.1364.172 m error I get in jQuery 1.9.1:

Uncaught TypeError: Cannot read property 'msie' of undefined kendo.all.min.js:8(anonymous function)kendo.all.min.js:8(anonymous function)kendo.all.min.js:8Uncaught TypeError: undefined is not a function fiddle.jshell.net:82

In addition, when deploying this same example side-by-side with the latest Telerik WebForms RAD controls, WebResource.axd line 6 also gives a JavaScript error complaining about getBaseTypes().

I am new to Web development, but my understanding is jQuery has continuously slimmed down the core jQuery library and taken away features.  Could it be that Kendo UI Pager is implicitly relying on a jQuery feature that is no longer available?  Since Kendo UI is linked to jQuery 1.9.1, I am looking for a solution from Telerik that doesn't involve upgrading jQuery.

Broadly, dynamically showing/hiding the pager seems like a basic feature that should be there, since the RadGrid supports dynamically showing/hiding the pager.

OS Version: Microsoft Windows 7 Professional
Browser Version: Google Chrome Version 25.0.1364.172 m
jQuery Version: 1.9.1
KendoUI Trial Version: kendoui.aspnetmvc.2013.1.319.trial.zip

[1] http://demos.kendoui.com/web/listview/index.html
[2] http://jsfiddle.net/johnzabroski/jf6cu/4/

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Apr 2013, 09:34 PM
Hello John,

The Kendo version used in the fiddle is from the begging of 2012 when jQuery 1.9 did not exist. You should update the Kendo scripts to the latest version in order to use jQuery 1.9. Please check this documentation topic which provides more detailed information on this matter.

As for your question about dynamically showing and hiding the pager - this is not supported but can easily be implemented by using the dataSource change event to check the number of records and show/hide the pager wrapper element.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
John
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or