Edit button not working with Datatables Editor

Edit button not working with Datatables Editor

mlacerdamlacerda Posts: 1Questions: 0Answers: 0
edited May 2012 in Plug-ins
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]

Replies

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    Hi,

    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
  • mlacerdamlacerda Posts: 1Questions: 0Answers: 0
    Hi Allan

    Can you help me?

    [quote] http://www.mauriciolacerda.com.br/siscad/restrito/create [/quote]
  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    > "sRowSelect": "mult",

    That should be "multi" - I suspect that is the issue.

    Allan
  • mlacerdamlacerda Posts: 1Questions: 0Answers: 0
    I made the change and still does not working.
  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    Ah - I've got it. You are using An old version of DataTables - namely 1.8.2. Editor uses a couple of the new API methods that were introduced in DataTables 1.9, so 1.9.x+ is required by Editor. I will add a code check in Editor to inform when this condition is not met, but for now, simply update your DataTables install to 1.9 :-)

    Allan
This discussion has been closed.