How to embed a jquery ui widget into a polymer-dart webcomponent

泪湿孤枕 提交于 2019-12-04 16:58:38

You can pass an element to jQuery instead of a selector. So the following code should work :

final element = $['datepicker'];
js.context.callMethod(r'$', [element]).callMethod('datepicker');

Just call JQuery on the element and then call datepicker(). The dart js package makes it human-readable:

import 'package:js/js.dart';

var element = shadowRoot.querySelector("#datepicker");
var $ = context.global[r'$'];
$(element).datepicker();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!