Setting a Default Row Example

Data sets load their data asynchronously, so you can't just create a data set, fire off a load and then set the current row. You have to register a data changed observer on the data set and then set the current row. We'll try to make this a bit easier in the future. But till then, this is an example of how to do it.

In this example we are going to load a bunch of names from an XML file into an HTML list, but we want to make sure that the default current row for the data set is the 3rd row. We'll add some conditionals to our list markup to ensure that our "current row" is hilited so we can verify that the 3rd row is indeed the current row. You'll have to view the source of this page to see how this is accomplished.

Here's the running example: