O'Reilly logo

YUI 2.8 Learning the Library by Dan Wellman, Daniel Barreiro

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

Creating a DataTable

The constructor for DataTable takes the following arguments:

  1. A reference to a container that will hold the DataTable, either by its id or a DOM reference
  2. The column definitions that define the data to be shown and how it will be presented
  3. The instance of DataSource that will retrieve the data
  4. An optional object containing configuration attributes

The first argument can be any container in the page. Contrary to other controls we've seen previously, the DataTable is unable to read existing markup from the page. It is the DataSource that can read HTML tables so, in a way, the container referenced in the first argument may contain markup, but it will reach the DataTable via a roundabout route, through the DataSource. The DataTable ...

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