Comments (4)
Moving the rowFormatter function to the options attribute seems to work.
<ReactTabulator
columns={[...]}
data={[...]}
options={{
rowFormatter={(row) => {...}} //<- This works
}}
/>
I find it odd how using options like height and layout work at the root level of the Component's props, but other options like rowFormatter must be put under options.
from react-tabulator.
Thanks for reporting.
rowFormatter was missing as a first-class prop. I've just fixed it in the latest version.
Later on, I may have some pass-through logic to add all tabulator options as first-class props.
:]
from react-tabulator.
@Austint30 Please let me know if new version works for you. Thanks.
from react-tabulator.
@Austint30 Please let me know if new version works for you. Thanks.
It's worked for me! Thanks!
But, I wanted format my rows with Nested Tables like a: http://tabulator.info/examples/4.0#nested-tables
I got it, but, I had to import Tabulator to make Nested Tables exactly equal tabulator examples:
import Tabulator from "tabulator-tables"; //import Tabulator library
import "tabulator-tables/dist/css/tabulator.min.css"; //import Tabulator stylesheet
My ReactTabulator looks like this:
<ReactTabulator
ref={ref => (this.ref = ref)}
data={this.props.sector.humanresources}
locale={true}
columns={[
{
title: "Tipo",
sorter: "string",
field: "humanresource.name",
headerSortStartingDir: "desc",
locale: true,
headerFilter: false,
widthGrow: true
},
{
title: "Quantidade",
field: "quantity.planned",
editor: "number",
validator: ["integer", "min:0"]
},
{
formatter: deleteIcon,
align: "center",
// documentation: http://tabulator.info/docs/4.2/callbacks#cell
cellClick: (event, cell) => this.handleHumanResourcesRemove(event, cell)
}
]}
rowFormatter={
row => {
// documentation: http://tabulator.info/examples/4.0#nested-tables
//create and style holder elements
var holderEl = document.createElement("div");
var tableEl = document.createElement("div");
holderEl.style.boxSizing = "border-box";
holderEl.style.padding = "10px 30px 10px 10px";
holderEl.style.borderTop = "1px solid #333";
holderEl.style.borderBotom = "1px solid #333";
holderEl.style.background = "#ddd";
tableEl.style.border = "1px solid #333";
holderEl.appendChild(tableEl);
row.getElement().appendChild(tableEl);
var subTable = new Tabulator(tableEl, {
layout: "fitColumns",
data: row.getData().people,
columns: [
{ title: "Nome", field: "fullName", sorter: "fullName" },
{ title: "CPF", field: "documentId" },
{ title: "Email", field: "email" },
{ title: "Tel", field: "tel" },
{
formatter: editIcon,
align: "center",
cellClick: (event, cell) => this.handleHumanResourcesAddPerson(event, cell)
}
]
})
}}
dataEdited={data => this.handleHumanResourcesChange(data)}
layout={"fitColumns"}
autoResize={true}
reactiveData={true}
/>
My question is, can I make this with ReactTabulator only? (Without pure Tabulator)
May you make Nested Tables examples?
Thanks in advance!
from react-tabulator.
Related Issues (20)
- targets.row.findCell is not a function HOT 9
- Bug: Table does not reflect changed options HOT 1
- Managed data causes table re-render which breaks edit experience
- Update to Latest Tabulator Version to Fix Major Bug
- Question: rowClick throws error in react functional component HOT 4
- Responsive Collapse Not Working on latest version but works on version 0.15.0 HOT 1
- How to get data of entire table in react tabulator?
- Movable columns buggy on nested columns
- tabulator_tables_1.TabulatorFull is not a constructor
- bug: Issue on scrolling horizontally with the first column freeze and enable horizontal virtual dom HOT 2
- Is this repo updated frequently? HOT 1
- Add value "list" to Editor @types
- Bug: function reactFormatter uses ReactDOM.render HOT 6
- Can we expect update for the repo HOT 2
- movableRowsReceiver not working for me
- Bug: event target lookup error and column not update
- Columns cannot be resized in 0.19.0 HOT 3
- update to tabulator 5.6 HOT 2
- headerFilter select (list) doesn't work (Editable Table Example)
- Columns cannot be resized in 0.19.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-tabulator.