"settings Is Not Defined" When Trying To Use "getselection" On Gridview

I have one gridview on this page that’s loaded normally, not through ajax or anything like that. When I try to use the following code to get the selected row, nothing happens and I see the error “settings is not defined” in Firebug.




'selectionChanged' => 'function(id){

        row = $(id).yiiGridView("getSelection");

        alert(row);

}



Any ideas? How can I see if the settings are set? Thanks!

Update:

Same issue exists in a new app with a form generated in gii. Am I using the "getSelection" function wrong or something?

Try this:




'selectionChanged' => 'function(id){

        alert(id);

        var row = $("#"+id).yiiGridView("getSelection");

        alert(row);

}'



the “id” parameter doesn’t include the hashmark (# - id selector in jQuery)