Sunday, January 10, 2010

Found Solution to Row Selection Problem in Dashcode

So after a while of playing around, I found that my problems earlier were due simply because I was trying to get data from the wrong datasource.

A quick and simple tip for everybody so that you do not have to go through what I did:
Make sure that you are trying get your selected data from your list datasource, not the original datasource for the list (if that makes sense).

Here is some code:

function myRowClickHandler(event){
  // make sure to grab the datasource specifically for your list
  var myDataSource = dashcode.getDataSource('myList');
  // Simply alert out the selected row data
  alert(myDataSource.selection().valueForKey('person_name'));
}

1 comment:

  1. Doesn't work.. there is no method dashcode.getDataSource.. any idea?

    ReplyDelete