jquery-steps icon indicating copy to clipboard operation
jquery-steps copied to clipboard

ContentCache for inserted steps

Open swehurricane opened this issue 12 years ago • 4 comments

Thanks for a great plugin. Wish I would've found it sooner. Makes my long forms much more readable. :)

I do have an issue when inserting steps: $('#wizard').steps('insert', 1, { title: 'Bla', contentMode: "async", contentUrl: "url to whatever" });

Works just great but when I try to set enableContentCache: true, it still goes in to the if (!options.enableContentCache || !currentStep.contentLoaded) statement in the jquery.steps.js file (line 645). Seems like currentStep.contentLoaded is always false. Is there no way to cache the contents of these inserted steps?

swehurricane avatar Dec 10 '13 21:12 swehurricane

I found a solution: The flag currentStep.contentLoaded is NOT set to true in the function "loadAsyncContent" You should add a line: currentStep.contentLoaded = true; right before this line (inside the function "loadAsyncContent") wizard.triggerHandler("contentLoaded", [currentIndex]);

marcelogaio avatar Dec 27 '16 15:12 marcelogaio

(only 3 years late... hehe)

marcelogaio avatar Dec 27 '16 15:12 marcelogaio

Only 5 years Late hehe :)

sameedaris avatar Dec 24 '18 16:12 sameedaris

You saved me the trouble of debugging it. Still why haven't this been patched yet? Cheers mate

LE: this solution forcefully caches the current step even if you set the enableContentCache off. Just a side note. LE2: ok here is the complete solution, that seems to work properly even with enableContentCache off. I haven't had a lot of time to debug it so if there is any issue just point it out.

Before this line wizard.triggerHandler("contentLoaded", [currentIndex]); Add this. if( options.enableContentCache ){ currentStep.contentLoaded = true; } Now go up a bit and change if (!options.enableContentCache || !currentStep.contentLoaded) To if (!currentStep.contentLoaded) This should enable you to set the enableContentCache on or off, and get a proper control over caching

tamas-web avatar Aug 29 '19 21:08 tamas-web