Last active
February 16, 2017 05:23
-
-
Save MikeTatsky/30d8fa2bf13344fb3aae4528eb5d0e17 to your computer and use it in GitHub Desktop.
Form sample to edit grid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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