Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81929

Inline editor doesn't display the cell text

$
0
0

I'm new with datatables and I'm trying to use inline editor with edit-icon.
My problem is that when I click on the edit icon the inline field appear but it is empty, it doesn't get the text.
The same thing happens with bubble editor.
Where am I doing wrong?
Thanks in advance for the help,
Alida

My datatable is this:

$('#table').DataTable({
dom : '<"H">rtB<"F">'
, language : { url : (curlang === 'it-it' )? snsbaseurl + "/sns/js/it-it.txt" : '' }
, processing : true
, serverSide : false
, data: $.map( data, function (value, key) {
return value;
} )
, jQueryUI : false
, responsive : true
, deferRender : true
, pagingType : "full_numbers"
, renderer : "bootstrap"
, idSrc: "id"
, createdRow: function( row, data, dataIndex ) {
JQ(row).attr('data-editor-id', data.DT_RowId);
}
, columns : [
{ className : "never" , data:"id", name:"id" }
, {
className : "center",
data:"field1",
name:"field1",
editField: "table.field1",
render: editIcon,
createdCell: function (td, cellData, rowData, row, col) {
$(td).attr('data-editor-field', "field1");
}
}

                          ]

                      , order : [[1, 'asc']]
                      , select: true
                      , buttons: [
                                { extend: "create",
                                  text: "Create new",
                                  editor: editr,
                                  className: "btn",
                                  formTitle: "Insert new",
                                  formButtons: [
                                        'Add',
                                        { label: 'Cancel', fn: function () { this.close(); } }
                                      ]
                        }]

                });

And the editor is:
var editor= new $.fn.dataTable.Editor( {
table: "#table"
, idSrc: "id"
, fields: [
{
label: "Label for field1:",
name: "table.field1"
}
]
, ajax: function ( method, url, d, successCallback, errorCallback ) {
// creation new element
}
} );

$('#table').on( 'click','td i.edit', function (e) {
e.stopImmediatePropagation(); // stop the row selection when clicking on an icon

        editor.inline( $(this).parent() );

    } );

Viewing all articles
Browse latest Browse all 81929

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>