Re caching content

35 views
Skip to first unread message

erickton erickton

unread,
Mar 16, 2014, 4:17:11 PM3/16/14
to trees...@googlegroups.com
Hello,
Thank you guys for this great tool.
I'll need to to know if it is possible to re cache the content on the current article. 
Beacuse i have som checkboxes in some of my pages and if i check one checkbox and contiues to other pages and then return to the page with the checkboxes the checkboxes are not checked.

And for off the record the checkboxes its controlled by ajax so if i reload the article it shows up checked and so on.

I have tried with, documentchanged articlechanged and so on but with no results.

Thanks in advance, and excuse me for my bad english.

Regards Erickton

Tadej

unread,
Mar 18, 2014, 4:45:35 AM3/18/14
to trees...@googlegroups.com
Hey,
every time the page is drawn, it's rendered from scratch, so in any case, you need to keep the model state out of the actual elements. You should probably hook tpo the treesaver.pageschanged event, which is what gets called on every page render, and then have your code tick the appropriate checkboxes on that page.
-- Tadej



--
You received this message because you are subscribed to the Google Groups "Treesaver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to treesaverjs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

erickton erickton

unread,
Mar 19, 2014, 9:33:59 AM3/19/14
to trees...@googlegroups.com
Hello, thank you for the point.

I did like this,
I saved the state of a click in an array and but it only works when the column gets currentPage... the columns on the sides is not affected i dont no why.
But my guess is that this code runs before the other columns have been outputed... 

treesaver.addListener(document,'treesaver.pageschanged',changeData);
    function changeData(event){
    jQuery(ItemsArray).each(function(){
       var obj = '[data-id='+this.id+']';
        jQuery(obj).removeClass("checked");
          jQuery(obj).addClass(this.classes);
    });
    }

tadej...@gmail.com

unread,
Mar 19, 2014, 6:06:02 PM3/19/14
to trees...@googlegroups.com
Aren't with jQuery checboxes usually switched on by saying:

jQuery(obj).prop("checked", true)
or
jQuery(obj).prop("checked", false)
?

Not sure if that would solve your problem though..
-- Tadej
Reply all
Reply to author
Forward
0 new messages