1

I am trying to listen to the jQuery onchange event in dart as the native onchange event is not firing when using a jQuery date picker.

Here is my current code

js.context.jQuery("#venueDatePicker").on("change", new js.Callback.many((e, data) {
    print("Will be executed");
}));

Here is the error i am getting

malformed type: line 61 pos 63: type 'js.Callback' is not loaded
            js.context.jQuery("#venueDatePicker").on("change", new js.Callback.many((e, data) {
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Jake Rote
  • 2,177
  • 3
  • 16
  • 41

1 Answers1

2

not tested but I think it should be like:

js.context.callMethod(r'$', ["#venueDatePicker"])
    .callMethod('on', ["change", (e, data) {
      print("Will be executed");
    }]);
Alexandre Ardhuin
  • 71,959
  • 15
  • 151
  • 132
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567