JQuery Grid - set value open next cell editor

Disable Grid in window

by mogador

HTML

<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="https://jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/generatedata.js"></script>
<p>
click on Disable GRID : you still can click  on a checkbox, but just one time… the checkbox gets disabled AFTER the first click.
</p>
<button id="bt_disable">Disable GRID</button>
<br /><br /><br />

<div id="grid"></div>

JavaScript

var data = '[{ "bChk": true, "Country": "Belgium"}, {"bChk": false, "Country": "France"}]';

// prepare the data
var source = {
  datatype: "json",
  datafields: [{
      name: 'bChk',
      type: 'bool'
    },
    {
      name: 'Country',
      type: 'string'
    }
  ],
  localdata: data
};
var dataAdapter = new $.jqx.dataAdapter(source);

$("#grid").jqxGrid({
  width: 200,
  source: dataAdapter,
  selectionmode: 'singlecell',
  autoheight: true,
  editable: true,
  columns: [{
      text: '',
      datafield: 'bChk',
      columntype: 'checkbox',
      editable: true
    },
    {
      text: 'Country',
      datafield: 'Country',
      width: 150,
      editable: false
    }
  ]
});

$("#bt_disable").click(function() {

$("#grid").jqxGrid({disabled: true});
});