Skip to content

Instantly share code, notes, and snippets.

@MikeTatsky
Last active February 16, 2017 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeTatsky/30d8fa2bf13344fb3aae4528eb5d0e17 to your computer and use it in GitHub Desktop.
Save MikeTatsky/30d8fa2bf13344fb3aae4528eb5d0e17 to your computer and use it in GitHub Desktop.
Form sample to edit grid
var form = new FancyForm({
renderTo: 'form',
title: 'User Data',
width: 290,
height: 500,
defaults: {
type: 'string'
},
items: [{
name: 'id',
type: 'hidden'
}, {
label: 'First Name',
name: 'first_name'
}, {
label: 'Last Name',
name: 'last_name'
}, {
label: 'eMail',
name: 'email'
}, {
label: 'Organisation',
name: 'organisation'
}],
buttons: ['side', {
text: 'Clear',
handler: function () {
form.clear();
}
}, {
text: 'Save',
handler: function () {
var values = form.get();
if (!values.id) {
return;
}
grid.setById(values.id, values);
}
}]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment