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

MonthYearPicker set_visible() & get_textBox() not working

3 Answers 27 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Shole
Top achievements
Rank 1
Shole asked on 24 Sep 2015, 02:06 AM

Hi community,

I have a several RadDatePicker and one RadMonthYearPicker control on a simple page.

I was trying to hide some of them by condition through client side event only, so I write a handler and try to use client object methods to hide them.

 My handler looks like:

function handler(){
    alert("before");
    $find("<%= RadDatePicker1.ClientID %>").set_visible(false);
    $find("<%= RadMonthYearPicker1.ClientID %>").set_visible(false);
    alert("after");
}

Both alert message pop up without any javascripts error, but none of the control is hidden...

This is my first trial, then I try to work around with get_textBox() and hide the text box rendered.

 

function handler2(){
    alert("before");
    $($find("<%= RadDatePicker1.ClientID %>").get_textBox()).hide();
    $($find("<%= RadMonthYearPicker1.ClientID %>").get_textBox()).hide();
    alert("after");
}

Now the DatePicker is hidden but not the MonthYearPicker...

What have I do wrong and how can I achieve such easy tasks?

I am using Telerik Ajax 2012.1.411, and my browser is Chrome & IE8+

Thanks!

3 Answers, 1 is accepted

Sort by
0
Shole
Top achievements
Rank 1
answered on 24 Sep 2015, 03:25 AM
0
Shole
Top achievements
Rank 1
answered on 24 Sep 2015, 06:16 AM

Never mind, I find out the cause of the problem is due to some CSS rules added before to fix IE problems according to this post:
http://www.telerik.com/forums/raddatepicker-rendering-problem-in-ie9-compatibility-mode

 And when set_visible(false) is called, the wrapper element will normally set to "display: none", however it is override by the CSS rules "display: inline !important" as said in the link.

I am now wrap one more div out of the control and change the visibility of this div as a workaround solution. 
I wonder if this problem has an official solution?

 

 

 

0
Viktor Tachev
Telerik team
answered on 24 Sep 2015, 12:32 PM
Hi Shole,

The issue discussed in the article you are referring to should not be available in the current version of the controls. The current version of the controls is 2015.2.826. Please upgrade to the latest release and see how it works for you.

Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Calendar
Asked by
Shole
Top achievements
Rank 1
Answers by
Shole
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or