I am using Ext.js 4. I have a panel which contains log messages returned from the server.
The following will append the most recent messages to the that panel:
// show log on the log panel
logPanel.add( { xtype: 'box', autoEl: { cn: theText } } );
I also add a separator bar between messages:
// add a separator bar
logPanel.add( { xtype: 'box', autoEl: { html: '<hr/>'} } );
I thought about clearing the panel before adding new messages, so only the most recent messages appear, and this works (when placed before the above):
// the following will remove prior log messages...
logPanel.removeAll();
But what I would really like to do is simply put the most recent messages BEFORE the previous messages (the default action of the add method is AFTER).
Any suggestions on how I could do that? Thanks in advance.
Use the insert method: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.container.AbstractContainer-method-insert