【问题标题】:Ext js: how to move element in DOMExt js:如何在 DOM 中移动元素
【发布时间】:2012-04-04 12:14:36
【问题描述】:

Ext 中是否有一种很好的方式来移动 DOM 中的元素?我想将元素 'iShouldBeInsideTheBox' 移动到 'box' 元素内,然后回到它在两个 p 元素之间的原始位置:

<p>
    surrounding text
</p>
<p id="iShouldBeInsideTheBox">
    This should be inside the box
</p>
<p>
    surrounding text
</p>
<p id="box">
    Some content in the box
</p>

我在 jQuery 中花了四行代码(小提琴:http://jsfiddle.net/F2PXw/19/),但我想不出在 Ext(或纯 JS,如果它可靠的话)中做到这一点的简单方法。

【问题讨论】:

    标签: javascript dom extjs dom-manipulation


    【解决方案1】:

    你想要什么版本??

    ext 4.0.7: http://jsfiddle.net/mohammad_erdin/cdLPA/

    但是,应该可以在旧版本中使用...
    永远不要尝试:)

    还有一件事:
    请仔细看,Ext.getExt.query的区别
    Ext.get 中没有 # 字符

    【讨论】:

    • 啊,我明白了。 Ext 使用与常规 JS 相同的方法名称。这样就可以了,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-15
    • 2023-03-04
    • 1970-01-01
    • 1970-01-01
    • 2021-04-13
    • 2020-02-11
    相关资源
    最近更新 更多