Hey,
I would like to disable some times in a timepicker like in the demo:
but unfortunately I can't find any information about it anywhere.
My goal is the following:
I select a date from the DatePicker and send an API call to my controller where I get back all the times which are reserved for that date and disable all these times in the timepicker.
I found a "disableItemCollection" property in the timepicker but I'm not sure it is what I need and how to use it.
Thank you in advance!
Ferenc
| <div class=" control-section"> <div class="timepicker-section"> <div id="wrapper" class="timepicker-control"> <div class="tabs-wrap"> <div class="wrap"> <ejs-timepicker id="timepicker" itemRender="itemRender" Item placeholder="Select a time"></ejs-timepicker> </div> </div> </div> </div> </div> <script> function itemRender(args){ if (args.text == '12:00 AM' || args.text == '7:00 AM') { args.isDisabled = true; } } </script> |
Hello Vinitha,
thank you this works properly, just another question. How can I call this function in another place? It waits for the args paramter. What should I give it?
itemRender(???) ?
Thank you, in advance!
Ferenc
Hello Vinitha,
in the meantime I think I figured it out how it works. If I click on the "clock" button in the Timepicker the function is called then. So I have to make my ajax call inside it and not call it from another function. Or at least I tink so... :)
Ferenc
Hello Ferenc,
ItemRender is an event handler triggers when each popup item is rendered. This cannot be called from another function, but you can make calls to another function. Please let us know if you need any further assistance.
Regards,
Prince