PDA

View Full Version : Updating/Refreshing Markup



so.phis.ti.kat
25 Jul 2013, 7:31 AM
Hello Community,

I am struggling with updating the markup after updating my routes. Here's how it work. My view listens for the 'painted' event, who then calls two methods. These two methods, gets the route values and based on those values, my markup is modified. This works like a charm.

showActive: function () {

// activate top menu
this.parent_menu = Ext.get(this.routeParams.productId);
this.parent_menu.addCls('active');


// activate current page
this.child_menu = Ext.get(Ext.DomQuery.select(['.',this.routeParams.pageId].join(''), this.routeParams.productId)[0].parentElement);
this.child_menu.addCls('active');
}



In my controller, I listen for a tap event that updates my route


event: 'tap',
fn: function(button, evt) {
var myId = button.target.attributes[0].nodeValue,
parentId = button.delegatedTarget.parentElement.parentElement.id;


MYAPP.app.redirectTo(['/products', parentId, myId].join('/'));
}

Once my route is updated, no matter what I try, I cannot update my markup. So how on earth can I do this? Here are a couple of things I tried:
1. After my redirectTo call, I delay for 1 second, attempt to call my methods that eventually call my 'showActive' and nothing. If I refresh the page after this call, the code works.
2. I tried keeping track of the items but on refresh, all parameters are cleared

Any advice?

so.phis.ti.kat
25 Jul 2013, 8:00 AM
Hello Community,

As always, soon after you post a new thread, you find something. I just noticed that after I call 'redirectTo', the main container is not being updated, it is being duplicated. So I must have missed something in the docs, if anyone can point me in the right direction, cheers!