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

Hide or Show TimeSlotContextMenu

3 Answers 72 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 21 May 2013, 08:04 AM
Now, I'm using RadScheduler to book the ticket for a cinema.
for example, on 21/05/2013,  for this movie named "Movie1", if the tickets still avaliable, TimeSlotContextMenu should Show, otherwies , need to hide TimeSlotContextMenu.

3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 21 May 2013, 02:39 PM
Hello James,

Attached to this ticket you can find a very simplified runnable page demonstrating how to disable the items from the context menu depending on the particular time slot in the RadScheduler. Of course you can further expand the logic so that it complies with your particular scenario.

Kind regards,
Kate
the Telerik team
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 their blog feed now.
0
James
Top achievements
Rank 1
answered on 22 May 2013, 02:53 AM
Hi Kate,
 
 protected void OnTimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
{

 if (e.TimeSlot.Start.Date < DateTime.Now.Date)
  e.TimeSlot.Control.Attributes.Add("isHide", "true");
else
  e.TimeSlot.Control.Attributes.Add("isHide", "false");

}

How to get the value of Attributes "isHide" in event
 function onClientTimeSlotContextMenu(sender, args) {

var menu= sender.get_timeSlotContextMenus()[0].get_items().getItem(0);
//menu.hide() or menu.show() based on Attributes "isHide".

}

0
Kate
Telerik team
answered on 22 May 2013, 08:33 AM
Hi James,

In your particular case you can use the following line of code in order to get the value of the isHide attribute as explained in more details here:
 

//returns the value of isHide attribute  
 sender.get_timeSlotContextMenus()[0].get_items().getItem(1).get_attributes().getAttribute("isHide");
 

Regards,
Kate
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 their blog feed now.
Tags
Scheduler
Asked by
James
Top achievements
Rank 1
Answers by
Kate
Telerik team
James
Top achievements
Rank 1
Share this question
or