editReturns: grid

Enable edit mode for all editable cells within a row.

Parameters

NameTypeDescription
id {string} The id of the row that needs to be edited

Examples

Edit Row

    
 <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
 <table id="grid"></table>
 <script>
     var grid, renderer;
     renderer = function (value, record, $cell, $displayEl, id) {
         var $editBtn = $('<i class="fa fa-pencil gj-cursor-pointer" data-key="' + id + '"></i>'),
             $updateBtn = $('<i class="fa fa-save gj-cursor-pointer" data-key="' + id + '"></i>').hide();
         $editBtn.on('click', function (e) {
             grid.edit($(this).data('key'));
             $editBtn.hide();
             $updateBtn.show();
         });
         $updateBtn.on('click', function (e) {
             grid.update($(this).data('key'));
             $editBtn.show();
             $updateBtn.hide();
         });
         $displayEl.append($editBtn).append($updateBtn);
     }
     grid = $('#grid').grid({
         primaryKey: 'ID',
         dataSource: '/Players/Get',
         inlineEditing: { mode: 'command', managementColumn: false },
         columns: [
             { field: 'ID', width: 56 },
             { field: 'Name', editor: true },
             { field: 'PlaceOfBirth', editor: true },
             { width: 56, align: 'center', renderer: renderer }
         ]
     });
 </script>