2012-02-20 92 views
1

我正在使用Ext.js 4.我有一個包含從服務器返回的日誌消息的面板。Ext.js4 - 將一個框添加到面板的頂部而不是底部

下面將最新的消息追加到該面板:

// show log on the log panel 
logPanel.add({ xtype: 'box', autoEl: { cn: theText } }); 

我還添加消息之間的分隔條:

// add a separator bar 
logPanel.add({ xtype: 'box', autoEl: { html: '<hr/>'} }); 

我添加新的消息之前想過清除面板,所以只有最近的消息出現,並且這起作用(當放置在上述之前時):

// the following will remove prior log messages... 
logPanel.removeAll(); 

但是我真正想要做的只是在之前的消息之前放置最近的消息(add方法的默認操作是AFTER)。

有關我如何做到這一點的任何建議?提前致謝。

回答

相關問題