I have a DatePicker class, which is called from different functions at different locations with different options.
Now I have added a selectbox, which loads extra options for DatePicker depending on selected value.
on Selectbox’s onchange event I want to refresh the DatePicker, with the extra options.
But as the DatePicker can be called from Different functions, with different options/setting
and the onChange event actually don’t knows which function was lastly called, But I have a Global datapicker object.
Is there a way to call the Same function again which was lastely called to display DataPicker?
You can update a variable inside the DatePicker class – a variable that holds the caller id, or name, or anything you want. If a function calls DatePicker, it will also update the class variable via the “initializer” of the class, and then in onChange, you can check who called the DatePicker by checking that variable, and do relevant stuff. 😉