文档彩票走势图>>DevExtreme 中文文档>>getInstance(element)
getInstance(element)
getInstance(element)
获取使用其DOM节点找到的UI组件的实例。
- Parameters:
- element: |
- UI组件的容器。
- Return Value:
- UI组件的实例。
getInstance是UI组件类支持的静态方法,下面的代码演示了如何获取ID为myAccordion的元素中的Accordion实例:
// Modular approach import Accordion from "devextreme/ui/accordion"; ... let element = document.getElementById("myAccordion"); let instance = Accordion.getInstance(element) as Accordion; // Non-modular approach let element = document.getElementById("myAccordion"); let instance = DevExpress.ui.dxAccordion.getInstance(element);