O'Reilly logo

Moodle JavaScript Cookbook by Alastair Hole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enabling scrolling

In this recipe, we will implement a scrolling data table, an alternative method to paging that allows us to better handle the display of large data sets which would be cumbersome to display in full.

We will do this by using an alternative, but similarly defined YUI control: ScrollingDataTable.

Getting ready

Open datatable.js file for editing. We will modify the definition of the dataTable object.

How to do it...

Modify the dataTable definition to match the following code:

var dataTable = new YAHOO.widget.ScrollingDataTable ("container", columns, dataSource, {
height: "150px"
});

How it works...

We used the alternative control ScrollingDataTable, passing in a configuration object as the fourth argument. This configuration object simply ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required