Skip to content

Instantly share code, notes, and snippets.

@enovision
Created June 6, 2013 21:52
Show Gist options
  • Save enovision/5725307 to your computer and use it in GitHub Desktop.
Save enovision/5725307 to your computer and use it in GitHub Desktop.
W2UI Framework - Toolbar handler. A button click is handled on the toolbar (target = id of the button, data = the event object)
jQuery('#grid').w2grid({
name: 'grid',
recordsPerPage: 25,
fixedRecord: false,
url: '/wp-content/plugins/GarageSoftware/ajax/AjaxLoadOccasions.php',
show: {
header: true,
footer: true,
toolbar: true
},
toolbar: {
items: [
{type: 'check', id: 'history', caption: 'Historie', img: 'icon-page', checked: false}
],
onClick: function(target, data) {
if (target == 'history') {
var grid = this.owner;
grid.postData['history'] = !data.item.checked;
grid.load(grid.url);
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment