文檔首頁(yè)>>DevExtreme 中文文檔>>getInstance(element)
getInstance(element)
getInstance(element)
獲取使用其DOM節(jié)點(diǎn)找到的UI組件的實(shí)例。
- Return Value:Object
- UI組件的實(shí)例。
getInstance是UI組件類支持的靜態(tài)方法,下面的代碼演示了如何獲取ID為myAccordion的元素中的Accordion實(shí)例:
// 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);