Html Grid

Bind to the bindingcomplete event by type: jqxGrid. Author: http://jqwidgets.com

by Hristo Hristov

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>
<div id='jqxWidget'>
    <div id="jqxgrid"></div>
    <button id="btn">Click</button>
</div>
<div id="log"></div>

JavaScript

var data = generatedata(500);
 var source = {
     localdata: data,
     datafields: [{
         name: 'firstname',
         type: 'string'
     }, {
         name: 'lastname',
         type: 'string'
     }, {
         name: 'productname',
         type: 'string'
     }, {
         name: 'date',
         type: 'date'
     }, {
         name: 'quantity',
         type: 'number'
     }, {
         name: 'price',
         type: 'number'
     }],
     datatype: "array"
 };
 $('#jqxgrid').on('bindingcomplete', function (event) {
     alert("Binding is completed" );
 });
 var adapter = new $.jqx.dataAdapter(source);
 $("#jqxgrid").jqxGrid({
     width: '100%',
     theme: 'energyblue',
     source: adapter,
     sortable: true,
     selectionmode: 'singlecell',
     columns: [{
         text: 'First Name',
         datafield: 'firstname',
         columngroup: 'Name',
         width: '7%'
     }, {
         text: 'Last Name',
         columngroup: 'Name',
         datafield: 'lastname',
         width: '7%'
     }, {
         text: 'Product',
         datafield: 'productname',
         width: '7%'
     }, {
         text: 'Order Date',
         datafield: 'date',
         width: '7%',
         cellsformat: 'dd-MMMM-yyyy'
     }, {
         text: 'Quantity',
         datafield: 'quantity',
         width: '7%',
         cellsalign: 'right'
     }, {
         text: 'Unit Price',
         datafield: 'price',
         cellsalign: 'right',
         cellsformat: 'c2'
     }]
 });

$('#btn').click(function () {
    console.log('update');
	$('#jqxgrid').jqxGrid('updatebounddata');
});