Don Li
Don Li

Reputation: 1095

jqgrid: 'addRowData' does not work

I need to use a customised button to add a new row with inline mode. After clicking on the button, the new row does appear, but it is not in edit mode, then I have to click edit button, resulting there is no any "insert" SQL statement sent to db.(ony "update" SQL sent to DB). Can anyone help me out here? Thanks. Also I dont know what value should be set to "rowId" when calling addRowData.

$buttonoptions = array("#pager",
    array("caption"=>"Add", 
          "onClickButton"=>"js: function()
          {
            var myData = [{'phone':'82345674', 'owner': 'abc'}];                
            jQuery('#grid').jqGrid('addRowData','undefined',myData);            
          }
          "));
$grid->callGridMethod("#grid", "navButtonAdd", $buttonoptions);

Upvotes: 0

Views: 1213

Answers (1)

venugopal
venugopal

Reputation: 447

If you want the added row to be opened immediately instead of addRowData ,go for addRow method

Upvotes: 1

Related Questions