LazyLoading of images with DataTables

1 reply · opened Aug 20, 2020

LLogicWizeAug 20, 2020

Canvas version 6.04, Bootstrap 4.
I am having issues with the DataTable component where on loading the next set of data, it does not fire the lazyLoad function that is used by Canvas.

Sample of where it is running: https://php.breathlist.com/insiders/edite-strautmane/

The script that, according to StackPath is to be used is pasted below... the drawCallback fires, but the LazyLoad function does not.


  $(document).ready(function() {
    $('#datatable1').DataTable( {    	
      drawCallback: function() {
        $("img.lazy").lazyLoad();
      }
    });
  });

Any ideas what goes wrong here?

Thx, Marcel

LLogicWizeAug 20, 2020

Found the answer already. This seems to be doing the trick:


	$(document).ready(function() {

		$('#datatable1').DataTable( {    	
			drawCallback: function() {
				lazyLoadInstance.update();
		   }
		});

	});

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard