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

Change NumberOfSlots in Runtime

5 Answers 78 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 16 Apr 2009, 01:47 PM
Hi,

I'd like my users to be able to amend the number of slots shown in timelineview during runtime.  I've searched through the documentation but I can't find the method.

I have a RADScheduler set to Timeline View and a RADNumericTextBox on a RADMenu.  When my user types a number into the RADNumericTextBox I'd like to set the RADSchedulers NumberOfSlots to equal its value.  Is this something like the following code?

 

 

var numberofslots = RADNumericTextBox1.get_value();  
var scheduler = $find("<%= RadScheduler.ClientID %>");  
scheduler.timelineslots = numberofslots;  
gridComputers.repaint();   
 



Thanks
Jase

5 Answers, 1 is accepted

Sort by
0
Brett
Top achievements
Rank 2
answered on 17 Apr 2009, 03:42 PM
I also need a solution to this.

I would think that the code below should work but it doesn't. It does successfully set the number of slots to 5 when I debug and check the number of slots set using the getNumberOfSlots() method but the scheduler still only shows me 3 slots.

Telerik, can this actually be done client-side?
var scheduler = $find("<%= RadScheduler.ClientID %>");
scheduler.get_activeModel()._settings.numberOfSlots = 5
scheduler.get_activeModel()._getNumberOfSlots() //returns 5
0
Brett
Top achievements
Rank 2
answered on 17 Apr 2009, 08:17 PM
Update:

The code in my previous post partially works. I set the default number of slots to 32 when the page first loads then the code below runs to change it to 5 slots. 32 slots are still displayed in the Timeline but the date in the scheduler heading displays a timespan of 5 days and only appointments in the first 5 days are displayed.

It seems like the slot display is just not updating to the new number of slots.
0
Peter
Telerik team
answered on 20 Apr 2009, 10:17 AM
Hi Brett,

You can set the number of slots for timeline view dynamically in code-behind as in this demo:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/timelineview/defaultcs.aspx

RadAjax will help you get a client side experience when changing the number of slots.

We do not recommend you use the client API to get this functionality.

All the best,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Brett
Top achievements
Rank 2
answered on 20 Apr 2009, 11:08 AM
I'm using WCF & web-service binding so everything is done client-side. I have no postbacks or server-side calls after the initial page load.
0
Accepted
Peter
Telerik team
answered on 20 Apr 2009, 01:51 PM
Hi Brett,


We plan to implement auto-refresh (with polling) and expose a public Refresh method in the client API of RadScheduler.

Meanwhile, you can use the following workaroud:
function refreshSchedulerClientSide()   
{   
var scheduler = $find('<%= RadScheduler1.ClientID %>');   
scheduler.set_selectedDate(scheduler.get_selectedDate());   
}   
 


Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Jason
Top achievements
Rank 2
Answers by
Brett
Top achievements
Rank 2
Peter
Telerik team
Share this question
or