Skip to content

Instantly share code, notes, and snippets.

Created May 2, 2014 17:50
Show Gist options
  • Save anonymous/a708df16c2f0b56838db to your computer and use it in GitHub Desktop.
Save anonymous/a708df16c2f0b56838db to your computer and use it in GitHub Desktop.
Datatables Editor Field Naming Issue JS
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