EasyUI - How to add a new Item of Accordion on the top?

99封情书 提交于 2019-12-04 21:51:30

You can change the position of the item immediately after it is added. The following function moves the last element to the beginning of the accordion. In case you want to move the element to a different position you simply need to specify ids to the existing elements and then modify the selector accordingly.

function addItem(){
    $('#taskAccordion').accordion('add',{
        title: 'Perl',
        selected: false,
        content:'This is Perl.'
    });
    $('#taskAccordion').prepend($("#taskAccordion").children().last());
}  

1.delete old panels 2.add new panel 3.add old panels

But, the solution is foolish. hh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!