Reputation: 67
For instance I have a table which consist of Start and End dates. How could I possibly dynamically (optimize way) set the InitialFocusedDateValue so that each time the user opens a datepicker, the previous date he chose will be the Focused date.
I've already tried the following but none worked:
I've thought of looping through the table and assigning to each datepicker aggregation the InitialFocusedDateValue everytime a date is chosen but obviously this is a crappy approach. Hope there's an optimal way of resolving this.
Upvotes: 2
Views: 881
Reputation: 1301
If you want to set InitialFocusedDateValue for the Start Date depending on the End date of the previous row:
If you need to set End Date based on start date:
event.getSource().getParent().getContent()[indexOfEndDateControl].setInitialFocusedDateValue(dateValue)
Upvotes: 1