1

I have two Mobiscroll instances one for start time one for end time.

When someone chooses a start time, I want to update the possible end times based on that start time.

I have an ajax call which will give me the correct values for the wheel, but can't get this into the end times mobiscroll.

How do you do that?

1 Answers1

2

If you already have the values (from the ajax call), then you can put it into a select and use the select preset of the mobiscroll.

You can see a demo here!

EDIT

I misunderstood the question, or interpreted a different way. So if the second scroller has to be a datetime picker too then you should initialize it in the first scrollers OnSelect event!

$('#startDate').scroller({
     preset: 'date',
     onSelect: function(valueText,inst){
         //get the ajax call done here
         $('#endDate').scroller('destroy').scroller({
            preset: 'date',
            // set other settings like minDate or maxDate for the second scroller
         });
     }
});
zolipapa
  • 646
  • 6
  • 14