[pve-devel] [PATCH pve-manager] ext6migrate: remove redundant code to set the default active tab
Emmanuel Kasper
e.kasper at proxmox.com
Tue Dec 1 11:40:39 CET 2015
On 12/01/2015 07:33 AM, Dietmar Maurer wrote:
> Applied, but I see problems with this unreliable 'show' event behavior. Some
> widgets use 'show' and 'hide' this way (from dc/Summary.js):
>
> listeners: {
> show: rstore.startUpdate,
> hide: rstore.stopUpdate,
> ...
> }
>
> So if we miss 'show' events on reload, we do not start the update.
> Any idea how to solve that problem?
>
>
>> listeners: {
>> - afterrender: function(tp) {
>> - var first = tp.items.get(0);
>> - if (first) {
>> - first.fireEvent('show', first);
>> - }
>> - },
We have two kinds of components with a listener on show 'event' who
might be impacted by this.
The first case we send the 'show' event ourselves, like for dc/Summary.js
listeners: {
activate: function() {
nodegrid.fireEvent('show', nodegrid);
So here we are safe.
The second case is when we expect the 'show' event to be sent by the
Framework.
In that case we have to listen to other events, 'activate' vs
'deactivate' is the one I am thinking for tabs, since all the data we
display are in tabs, or in components embedded in tabs. We can also set
autoLoad to true in store when the need arises.
For instance I tested in dc/Log.js, this works as expected ( but still
need to be patched :)
listeners: {
activate: logstore.startUpdate,
deactivate: logstore.stopUpdate,
deactivate: logstore.stopUpdate,
}
Now concerning this removal,
>> - afterrender: function(tp) {
>> - var first = tp.items.get(0);
>> - if (first) {
>> - first.fireEvent('show', first);
>> - }
>> - },
none of the subclass of the ConfigPanel has a listener on the show
event, so this change should be safe too.
( some do have a dynamic store, but it's triggered differently, for
instance node/Config.js uses:
me.on('afterrender', function() {
me.statusStore.startUpdate();
});
More information about the pve-devel
mailing list