meteor-tabular
meteor-tabular copied to clipboard
Inline editing in Meteor tabular-tables
I need to add inline editing in my tabular-table. How to do this in meteor tabular-tables? Please, help)
Hi, I've been using it without problems EditableText and tmpl: at columns definition for my tables; maybe this can help
import { EditableText } from 'meteor/babrahams:editable-text';
TicketsTables.Tickets = new Tabular.Table({
name: "Tickets",
collection: Tickets,
columns: [ { data: "number", title: "Number" },
{ data: "title", title: "Title" },
{ data: "state", title: "State" },
{ data: "type", title: "Type" },
{ data: "pending", title: "Pending" },
{ data: "comment", title: "Comment",
tmpl: Meteor.isClient && Template.CommentCell } ],
order: [[2, "asc"],[4, "desc"],[0,"desc"]],
responsive: true,
autoWidth: false
});
<template name="CommentCell">
{{> editableText collection="tickets" field="comment" wysiwyg=true substitute='<i class="fa fa-pencil fa-lg"></i>' }}
</template>
<template name="TicketsTable">
<legend>Ticktes List</legend>
{{> tabular table=TicketsTables.Tickets class="table table-striped table-bordered table-condensed" }}
</template>