Meteor-Community-Packages / Meteor-Community-Packages/meteor-tabular

Datatable with Jeditable

Open
#334 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
360
Forks
132
PR merge metrics
No merged PRs in 30d

Description

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):

```
{{logs_subject_name}}
```

Thanks and Best Regards,
Manu

Contributor guide

Open the contributing guide

Research direction

Start with the Tabular.Table column definitions and the fnDrawCallback entry point shown in the issue, then compare them with the working normal Datatable markup. Trace how the editable cell is rendered and how Jeditable receives its element context; done means the row _id is available for the edit callback and can be passed to the Meteor Method.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.