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

Inline editing in Meteor tabular-tables

Open oDASCo opened this issue 7 years ago • 1 comments

I need to add inline editing in my tabular-table. How to do this in meteor tabular-tables? Please, help)

oDASCo avatar Jan 31 '18 13:01 oDASCo

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>

CarlosMC avatar Jul 02 '18 14:07 CarlosMC