PDA

View Full Version : BasicDialog usage decisions



griffiti93
30 Nov 2006, 9:30 AM
This post contains a couple of questions. I was first going to post separately, but decided to group the discussion. I have a BasicDialog for use with an order entry interface (see posting in Examples and Extras). I am trying to decide if I want to keep a reference to the dialog, and upon each load of an order, just rebind the data. Alternatively, I could destroy the dialog and build a new one each time.




What makes more sense, destroy and rebuild, or reuse and rebind?

If I did go the destroy route, how can I wire it up? I see the BasicDialog has a destroy() method. When would I call this? On the hide event? How would that code look?

griffiti93
30 Nov 2006, 9:34 AM
One more thing, if you call destroy(true), does it remove the div and all children elements from the DOM?

Animal
30 Nov 2006, 9:39 AM
Yes.

jack.slocum
30 Nov 2006, 1:46 PM
Reusing the dialog is definitely the best way.