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

RadSlider1.ClientID

1 Answer 48 Views
Slider
This is a migrated thread and some comments may be shown as answers.
neil fennessey
Top achievements
Rank 1
neil fennessey asked on 16 Feb 2012, 04:59 AM
Hi,

I see a few posts here on the slider.repaint(); and RadSlider1.ClientID as a possible fix.  We implemented this in order to allow a div/modal to appear without reloading the whole page.  No joy.

Here's the code:
function ShowDiv() {
                            var MainSearchDivID = '<%=MainSearchDiv.ClientID %>';
                            var MainD = document.getElementById(MainSearchDivID);
                            MainD.style.display = "block";

                            var btnShowDivID = '<%=btnShowDiv.ClientID %>';
                            var btnHideDivID = '<%=btnHideDiv.ClientID %>';

                            var btnShow = document.getElementById(btnShowDivID);
                            var btnHide = document.getElementById(btnHideDivID);

                            btnShow.style.display = "none";
                            btnHide.style.display = "block";
                            var slider = $find("<%= RadSlider1.ClientID %>");

                            slider.repaint();
                            return false;

                        }

We add the ShowDiv on the link which opens the div and yet the first panel shows nothing with the slider.  The slider uses letters a through z.  When you click 'b' you'll see the values associated with letter b and when you select a, you'll see the values associated with letter a.  It is as if the radslider1.clientid isn't recognized and that's why the results aren't populating.

Before my forehead finds the keyboard one more time...thoughts?   What are we missing.

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 16 Feb 2012, 02:01 PM
Hi neil,

 
I tested showing and repainting a slider but it works fine on my side. What I can assume is that for some reason (e.g too much HTML, etc) this happens a bit slowlier on your side. What I suggest is to try calling repaint with some small timeout (actually, 0ms usually does the trick) as follows:

function ShowDiv() {
                             var MainSearchDivID = '<%=MainSearchDiv.ClientID %>';
                             var MainD = document.getElementById(MainSearchDivID);
                             MainD.style.display = "block";
  
                            var btnShowDivID = '<%=btnShowDiv.ClientID %>';
                             var btnHideDivID = '<%=btnHideDiv.ClientID %>';
  
                            var btnShow = document.getElementById(btnShowDivID);
                             var btnHide = document.getElementById(btnHideDivID);
  
                            btnShow.style.display = "none";
                             btnHide.style.display = "block";
                             var slider = $find("<%= RadSlider1.ClientID %>");
 setTimeout(function(){
                            slider.repaint();return false;}, 0);
                             
  
                        }

Please, test my suggestion and in case you need further assistance, send me some fully working demo page and I will do my best to help.

All the best,
Svetlina Anati
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Slider
Asked by
neil fennessey
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or