method that shows the dialog retrieves the entire Grid dataItem. Thus, all fields for the respective row can be accessed there.
You can use similar approach and attach a click handler for the custom command. In the handler get the data item and the relevant fields. Then you can create a $.ajax request that will call the server-side action and pass the data as to it.
The showDetails method would look similar to this:
personId = dataItem.personId;
positionId = dataItem.positionId;
// additional custom code
Give the approach a try and let me know how it works for you.