Hi Dave,
two things I would try:
1. Verify that the compiler is being called. When you console.log('foo')
from your compiler, does your 'foo' appear after following an
[up-follow] link?
2. Also verify that DataTable can be invoked after the page was loaded.
When you wait for the page to load, open the console and manually call
$element.DataTable() on an existing element, does it initialize the table?
Best regards
Henning
On 05.04.20 01:06, Dave Burkholder wrote:
> First of all, thanks so much for Unpoly! I'm really enjoying it.
>
> I have a website that makes extensive use of Datatables
> <
https://www.datatables.net>, and all is working well, if I don't use
> up-follow. Clicking a normal link, or doing a full page load initializes
> the DataTable(s) fine.
>
> When I enable unpoly logging, I can see that the response actually does
> contain the target table ID, but for whatever reason, pages loaded when
> clicking up-follow links just don't initialize the table.
>
> I'm initializing the table like so...
>
> |
>
> up.$compiler('#target_table',function($element){
>
>
> vartable =$element.DataTable({
>
> "serverSide":true,
>
> "ajax":{
>
> "url":"/api/data",
>
> "data":function(d){
>
> d.keep ="pk,row_pk,is_active";
>
> }
>
> },
>
> <snip>
>
> });
> });
>
> |
>
>
> It's not the end of the world if I can't use up-follow to load the
> pages, but it'd be nice. The pages load more smoothly!
>
> Any thoughts / suggestions?
>
> TIA,
>
> Dave
>
> --
> You received this message because you are subscribed to the Google
> Groups "unpoly" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
unpoly+un...@googlegroups.com
> <mailto:
unpoly+un...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/unpoly/4e26ec97-f1fd-4515-8500-3d158f80aa8a%40googlegroups.com
> <
https://groups.google.com/d/msgid/unpoly/4e26ec97-f1fd-4515-8500-3d158f80aa8a%40googlegroups.com?utm_medium=email&utm_source=footer>.