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

.hideTab() and .showTab() not recognised

1 Answer 53 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Mych
Top achievements
Rank 1
Mych asked on 03 Jul 2013, 10:15 AM

I have an aspx page with a Splitter control.I have Sliding panels on the left and right hand side. The right hand side one is either hidden or shown dependant on a value in a hidden field. This works fine. I also want to hide/show some of the tabs also dependant on the value in a hidden field. My code is...

if (parseInt($('#hd_AC').val()) <= 10) {
                $('#Radsplitbar2').hide();
                $('#EndPane').hide();
                alert("Read-Only");
            } else if (parseInt($('#hd_AC').val()) == 20) {
                $('#RadSlidingPane_IP').showTab();
                $('#RadSlidingPane_BL').hideTab();
                $('#RadSlidingPane_Disc').hideTab();
                $('#RadSlidingPane_BU').hideTab();
                $('#RadSlidingPane_UIS').hideTab();
                $('#RadSlidingPane_CRA').hideTab();
                alert("Read-Only with Internal Personnel");
            } else if (parseInt($('#hd_AC').val()) >= 60) {
                $('#RadSlidingPane_IP').showTab();
                $('#RadSlidingPane_BL').showTab();
                $('#RadSlidingPane_Disc').showTab();
                $('#RadSlidingPane_BU').showTab();
                $('#RadSlidingPane_UIS').showTab();
                $('#RadSlidingPane_CRA').showTab();
                alert("HR - Admin View");
            } else {
                $('#Radsplitbar2').hide();
                $('#EndPane').hide();
                alert("Access not recognised");
            }
This code is run in the window.load() function. As I said the Radsplitbar2.hide() and EndPane.hide() when hd_AC.val()==10 works fine. When I test with hd_AC.val() ==20 then I get a javascript runtime error @  $('#RadSlidingPane_IP').showTab(); with an error message Object does not support this property or method. What have I done wrong?

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 04 Jul 2013, 02:45 PM
Hello Mych,

I would like to first ask that you use the most relevant forum, since you have issues with the RadSplitter control its forums would have been more appropriate than the RadSlider control forums.

On the issue itself - you need to use the public API of our controls instead of jQuery to modify them:
http://www.telerik.com/help/aspnet-ajax/splitter-client-side-radsplitter.html
http://www.telerik.com/help/aspnet-ajax/splitter-client-side-radpane.html
http://www.telerik.com/help/aspnet-ajax/splitter-client-side-radslidingzone.html
http://www.telerik.com/help/aspnet-ajax/splitter-client-side-radslidingpane.html

The following article explains how to get that reference:
http://www.telerik.com/help/aspnet-ajax/splitter-client-side-basics.html
Note how the $find() method from the MS AJAX framework is used.

What is also important is that these references are not available until the Sys.Application.Load event, a shortcut to which is the function with name pageLoad. You can also use the Sys.Application.add_load(fnName) and Sys.Application.remove_load(fnName) methods to attach/detach handlers to this event.

Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Slider
Asked by
Mych
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or