meteor-tabular icon indicating copy to clipboard operation
meteor-tabular copied to clipboard

Datatable with Jeditable

Open manusharma1 opened this issue 9 years ago • 0 comments

Hi @aldeed ,

I am trying to implement the inline editor using Jeditable via fnDrawCallback, below is my code I am able to get the edit mode and value but I am unable to retrieve the id, How to do it?, How can I pass _id in the cell so that it can get edited via Meteor Method, I just need _id

TabularTables = {};

TabularTables.LogsSubjects = new Tabular.Table({
  name: "LogsSubjects",
  collection: LogsSubjects,
  columns: [
    {data: "logs_subject_name", title: "Logs Subject Name", class:"editable"},
    {data: "order_id", title: "Order ID"},
    {
      data: "_id", title: "Delete", tmpl: Meteor.isClient && Template.deleteRow, searchable: false
    }
  ],

"order": [[ 1, "asc" ]],

"columnDefs": [
    { "sortable": false, "targets": 2 }
  ],


"fnDrawCallback": function () {

        $('.editable').editable(function(value, settings) {
         console.log(this._id),
         console.log(value);

        return value;

        }

        );

    }

});

I have also tried this in Normal Datatable and it is working fine there like this (I am facing Reactivity Issue there, thats why using your package):

<td><span class="editable" id="{{_id}}">{{logs_subject_name}}</span></td>

Thanks and Best Regards, Manu

manusharma1 avatar Aug 02 '16 14:08 manusharma1