1

I read about, how ExtJS4 keeps all the data of the components in separate objects and just renders DOM stuff on demand.

I have the problem, that a <div> gets a innerHTML = '' to hide some data and afterwards fills the innerHTML if the data is demanded.

If I render a component into that <div> it gets deleted when the hide functionallity is activated.

But all the component data is stored in a separate object, so is it possible to just re-render the stuff with its last state or just tell ExtJS to delete the DOM stuff by itself before it gets deleted and afterwards re-render it?

--- Edit ---

I think I found the problem (but no good solution)

When I define the component, I specify a <div> in renderTo if the parent <div> gets the innerHTML = '' it gets deleted, but later it gets recreated, with the same ID and stuff.

So when I call show() a <div> with the right ID exists, but it's a new object and the object I specified in the renderTo option is lost.

4

1 回答 1

0

我认为您应该使用 2 <div>,第一个将用于直接操作innerHTML;第二个是组件。当您通过设置 innerHTML 隐藏时,您可以隐藏下一个组件。重新渲染将是相反的步骤。

于 2012-05-10T20:18:05.737 回答