eduardotkoller/convForm

Destroy method

francoisriant opened this issue · 10 comments

Hi,

Verry cool plugin !
I wonder if it's possible to remove/destroy programaticaly convform and all his listener?

If you detach the wrapper from the HTML you are essentially destroying it. Do you want to keep the original form fields after destroying?

Great plugin!
Could you share the code of how to do that please?
Basically, I would like to reset and restart the chat.

Hi, I would also like to know how you can destroy the chat, so that you can start it back again later? Just detaching the wrapper hasn't worked for me... How did you @Xi-Flex @itayee solve this? Thanks!

OK I got it now. I'm saving the .html() of the chat in an JS var before the Chat starts. On the last button of the chat i did a recall function where I .remove() the whole chat and afterwards load the var, where I saved the html before, back in. I also cleared the stateWrapper, not sure if this is correct, but it works.

Hi. Did as you said, added a simple destroy method to the ConvState object that does exactly as you said: returns the form to its original state before the plugin. It seems to work as you intended to use -- you can recreate the chat using destroy() and then calling the jQuery method again.

Hi, can someone let me know how to use the destroy method to reinitiate the chat?

I used the destroy and the convForm methods however for some reason, the first question repeats twice. :(

how to use destroy() function???