Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

can.Component and "jQuery Mobile component refresh"

$
0
0
One of the things you have to do when using jQuery Mobile, is to refresh certain components in order to style them. This needs to be done when such components are inserted to the DOM after the jQuery Mobile library has loaded.

I have build a widget using can.Component. The widget consists of nested components.
In what place should I perform the jQuery Mobile refresh?

I am able to "catch" scope change events in the sub-components, but it seems that those events fires before the DOM has been fully updated, meaning that when I call refresh, it is normally too early.

I cannot do it from the "inserted" event, as that is only called during the initial insert.
As a temporary solution I use a setTimeout call in the scope change event, to delay when the update takes place, but that is just a bad solution as this exposes the un-styled component for ½ a second before it is styled.

In any case, I wish there was a 'updated' event that I could use.
And this leads me to a different problem...I cannot seem to find a list of supported "special" events.
I know of 'inserted' and '{scope} <id/class/element>', but even those are not in the API documentation.
If I just haven't looked at the correct place, could someone please point me in the right direction.


Viewing all articles
Browse latest Browse all 3491

Trending Articles