javascript object help needed
<p>I would like help to try and debug my code which returning an object and not what I expected to see. I am a novice to jquery and javascript and whilst learning, I cannot seem to debug this problem. When I output the output in console, I get object but all the data is there. What is supposed to happen, is that the id is passed to actionrow and this does the ajax call to the db. I would be grateful if someone could check the code and point out my obvious error. The oblect is being output from console.log(datarow); in the code. Many thanks</p>

<p>I am using <a href="http://www.jqwidgets.com" rel="nofollow">jqxWidgets</a> for grid and data</p>

<pre><code>// action row.
  $("#actionrowbutton").bind('click', function () {
   var selectedrowindex = $("#jqxgrid").jqxGrid('getselectedrowindex');
    var datarow = $("#jqxgrid").jqxGrid('getrowdata', selectedrowindex);
     var rowscount = $("#jqxgrid").jqxGrid('getdatainformation').rowscount;

    if (selectedrowindex &gt;= 0 &amp;&amp; selectedrowindex &lt; rowscount) {
         var rows = $('#jqxgrid').jqxGrid('getrows', selectedrowindex);
         var id = $("#jqxgrid").jqxGrid('getrowid', selectedrowindex);
         //var service = datarow;
           console.log(datarow);

   $("#jqxgrid").jqxGrid('actionrow', id);

    //Open action dialog window
   $( "#actionWindow" ).dialog({
     //title: 'action error',
       resizable: false,
       modal: true,
       position: ['center', 'center'],
          buttons: {
             "Ok": function() {
              $(this).dialog("close");

    $('#jqxgrid').jqxGrid('refreshdata');
    },
              Cancel: function() {
    $( this ).dialog( "close" );

    //$('#jqxgrid').jqxGrid('refreshdata');
    }
    }
 });
    }
});


actionrow: function (actrowid) {
            // synchronize with the server - send action command
            var data = "action=true&amp;id=" + actrowid;
           $.ajax({
        dataType: 'json',
        url: 'data.php',
        data: data,
        success: function (data, status, xhr) {
        // action command is executed.
        }
        });                         
        }
</code></pre>
