Edit button not working with Datatables Editor
Edit button not working with Datatables Editor
I need a help with this question.
The modal popup not working when I click on Edit button. Im using this example (http://editor.datatables.net/release/DataTables/extras/Editor/examples/envelope_buttons.html) in my code.
All the others functions are working (GET, INSERT and REMOVE) but UPDATE not working. Anybody can help me?
My code:
[code]
var editor;
$(document).ready(function() {
var envelopeConf = $.fn.dataTable.Editor.display.envelope.conf;
envelopeConf.attach = 'head';
envelopeConf.windowScroll = false;
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": CI_ROOT+"restrito/contatos",
"domTable": "#example",
"display":"envelope",
"fields": [
{
"label": "Nome:",
"name": "nome"
}, {
"label": "Cargo:",
"name": "cargo"
}, {
"label": "Telefone:",
"name": "telefone"
}, {
"label": "E-mail:",
"name": "email"
}
]
} );
$('#example').dataTable( {
"sDom": "Tfrtip",
"bFilter": false,
"bProcessing": true,
"sAjaxSource": CI_ROOT+'restrito/contatos',
"aoColumns": [
{ "mDataProp": "nome" },
{ "mDataProp": "cargo" },
{ "mDataProp": "telefone" },
{ "mDataProp": "email" }
],
"oTableTools": {
"sRowSelect": "mult",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
} );
Nome
Cargo
Telefone
E-mail
[/code]
The modal popup not working when I click on Edit button. Im using this example (http://editor.datatables.net/release/DataTables/extras/Editor/examples/envelope_buttons.html) in my code.
All the others functions are working (GET, INSERT and REMOVE) but UPDATE not working. Anybody can help me?
My code:
[code]
var editor;
$(document).ready(function() {
var envelopeConf = $.fn.dataTable.Editor.display.envelope.conf;
envelopeConf.attach = 'head';
envelopeConf.windowScroll = false;
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": CI_ROOT+"restrito/contatos",
"domTable": "#example",
"display":"envelope",
"fields": [
{
"label": "Nome:",
"name": "nome"
}, {
"label": "Cargo:",
"name": "cargo"
}, {
"label": "Telefone:",
"name": "telefone"
}, {
"label": "E-mail:",
"name": "email"
}
]
} );
$('#example').dataTable( {
"sDom": "Tfrtip",
"bFilter": false,
"bProcessing": true,
"sAjaxSource": CI_ROOT+'restrito/contatos',
"aoColumns": [
{ "mDataProp": "nome" },
{ "mDataProp": "cargo" },
{ "mDataProp": "telefone" },
{ "mDataProp": "email" }
],
"oTableTools": {
"sRowSelect": "mult",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
} );
Nome
Cargo
Telefone
[/code]
This discussion has been closed.
Replies
Thanks for the post. It looks to me like it should work given your setup. Can you link me to your page so I can investigate why this isn't working please?
Allan
Can you help me?
[quote] http://www.mauriciolacerda.com.br/siscad/restrito/create [/quote]
That should be "multi" - I suspect that is the issue.
Allan
Allan