Created
May 2, 2014 17:50
-
-
Save anonymous/a708df16c2f0b56838db to your computer and use it in GitHub Desktop.
Datatables Editor Field Naming Issue JS
This file contains 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
editor = undefined | |
$ -> | |
editor = new $.fn.dataTable.Editor( | |
ajax: | |
create: | |
type: "POST" | |
url: "/omi_event_fields" | |
edit: | |
type: "PUT" | |
url: "/omi_event_fields/_id_" | |
remove: | |
type: "DELETE" | |
url: "/omi_event_fields/_id_" | |
table: "#crudtable" | |
fields: [ | |
{ | |
label: "Name" | |
name: "name" | |
data: "0" | |
} | |
{ | |
label: "Custom Attribute" | |
name: "custom_attribute" | |
data: "1" | |
type: "checkbox" | |
ipOpts: [ | |
{ | |
"label": "", | |
"value": "True" | |
} | |
] | |
} | |
] | |
) | |
$("#crudtable").dataTable | |
dom: "<'row'<'col-sm-6'T><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>" | |
bServerSide: false | |
bAutoWidth: false | |
bDestroy: true | |
tableTools: | |
sRowSelect: "multi" | |
aButtons: [ | |
{ | |
sExtends: "editor_create" | |
editor: editor | |
} | |
{ | |
sExtends: "editor_edit" | |
editor: editor | |
} | |
{ | |
sExtends: "editor_remove" | |
editor: editor | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment