JavaScript
console.clear();
function log(message) {
var
log = $('#log'),
value = $.trim(log.val());
$('#log').val($('#log').val() + (value.length ? '\n' : '') + message);
}
function getGridDataAdapter() {
return new $.jqx.dataAdapter(
{
datatype: 'array',
datafields: [
{ name: 'id', type: 'number' },
{ name: 'name', type: 'string' },
{ name: 'typeId', type: 'number' },
{ name: 'typeName', type: 'string' },
{ name: 'count', type: 'number' }
],
localdata: [
{ id: 1, name: 'Item 1', typeId: 1, typeName: 'Type 1', count: null },
{ id: 2, name: 'Item 2', typeId: 1, typeName: 'Type 1', count: 0 },
{ id: 3, name: 'Item 3', typeId: 2, typeName: 'Type 2', count: 1 },
{ id: 4, name: 'Item 4', typeId: 2, typeName: 'Type 2', count: null },
{ id: 5, name: 'Item 5', typeId: 1, typeName: 'Type 1', count: null },
{ id: 6, name: 'Item 6', typeId: 1, typeName: 'Type 1', count: 0 },
{ id: 7, name: 'Item 7', typeId: 2, typeName: 'Type 2', count: 1 },
{ id: 8, name: 'Item 8', typeId: 2, typeName: 'Type 2', count: null },
{ id: 9, name: 'Item 9', typeId: 1, typeName: 'Type 1', count: null },
{ id: 10, name: 'Item 10', typeId: 1, typeName: 'Type 1', count: 0 }
],
beforeprocessing: function(data) {
console.log('beforeprocessing', arguments, this);
this.totalrecords = 12;
},
updaterow: function (rowid, rowdata, commit) {
console.log('updaterow', arguments);
log('updaterow');
log('Type ID: ' + rowdata.typeId);
commit(true);
},
deleterow: function (rowid, commit) {
...