nehakadam / AnyPicker

jQuery Picker Library for Android, iOS & Windows Phone. eg Date Picker, Time Picker, DateTime Picker, Custom Select etc
https://nehakadam.github.io/AnyPicker/
MIT License
116 stars 37 forks source link

get all AnyPicker instances #32

Closed danielgasser closed 6 years ago

danielgasser commented 6 years ago

First of all, thank you very much for that handy plugin.

In my case there are multiple instances of AnyPicker which are created dynamically:

$(els[0]).AnyPicker({ ... });
$(els[1]).AnyPicker({ ... });
// ... and so on

Then I tried to add them to a global array (window.datePickerInstances) in different ways with no success:

window.datePickerInstances.push(
    $(els[0]).AnyPicker({ ... });
);
// ... and so on

or like so:

var instance = $(els[0]).AnyPicker({ ... });
// ...
window.datePickerInstances.push(instance);

All it saves in the array is the selector of the instance but not the instance itself.

How do I achieve that?

thx for your help Daniel