How to get row id from GridView and send that data into modal box ?

How to get row id from GridView and send that data into modal box ?? I show data table : person :fname , lname etc.

I m using GridView::widget. I have button in last column in GridView , so when i clik on that button shows modal box, so in that modal box i want depends on which row i click to show me that data from person tabel in modal box.

Thanks

Every row has html attribute data-key which contains row id.

You can get id with jQuery and pass it to modal window




$(this).parents('tr').data('key');