material-table

How to use custom 'editComponent' in material-table?

若如初见. 提交于 2021-02-19 10:38:54
问题 I'm trying to use 'material-table' in my project. My 'icon' column contains icon name. I need change this icon by selecting it from external dialog. I have problem with updating table data from external dialog. When I use 'input' element and I change icon name, it works correctly. editComponent: props => ( <input type="text" value={props.value} onChange={e => props.onChange(e.target.value)} /> ) I don't know, how to achive this result with my dialog. I've created the following snipped project

How to use custom 'editComponent' in material-table?

六眼飞鱼酱① 提交于 2021-02-19 10:38:24
问题 I'm trying to use 'material-table' in my project. My 'icon' column contains icon name. I need change this icon by selecting it from external dialog. I have problem with updating table data from external dialog. When I use 'input' element and I change icon name, it works correctly. editComponent: props => ( <input type="text" value={props.value} onChange={e => props.onChange(e.target.value)} /> ) I don't know, how to achive this result with my dialog. I've created the following snipped project

How to use custom 'editComponent' in material-table?

只愿长相守 提交于 2021-02-19 10:37:13
问题 I'm trying to use 'material-table' in my project. My 'icon' column contains icon name. I need change this icon by selecting it from external dialog. I have problem with updating table data from external dialog. When I use 'input' element and I change icon name, it works correctly. editComponent: props => ( <input type="text" value={props.value} onChange={e => props.onChange(e.target.value)} /> ) I don't know, how to achive this result with my dialog. I've created the following snipped project

Any Example for custom pagination in material-table and reactjs

落花浮王杯 提交于 2021-02-18 22:52:58
问题 Any Example for custom pagination? material-table and reactjs . I want to pass from and to page size to the server and need to hide the first and last button from paging 回答1: Styudy this example https://material-table.com/#/docs/features/component-overriding in order to understand better the code i will show: With this you can access directly to the pagination component and make the call by your own. `components={{ Pagination: props => ( <TablePagination {...props} rowsPerPageOptions={[5, 10,

not able to fetch data through api in material table react

旧巷老猫 提交于 2021-01-28 00:20:08
问题 I am trying to fetch data throught api in material react table but its showing me an error as follows Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app code is mentioned below: import React, { Component } from 'react

How can I add/override Footer component in React material-table?

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-05 13:16:02
问题 I'm using react material-table. I'm having trouble in adding/overriding default footer component. By default, pagination component is rendered in footer. So, I tried overriding Pagination component to make it a simple footer like this <MaterialTable // other props options={{ search: true, selection: true, sorting: true, actionsColumnIndex: -1, paging: false, // true cause the rows truncation... i.e., paging anabled. showSelectAllCheckbox: true, toolbarButtonAlignment: "right",

Angular Material Table Sorting with reactive formarray

亡梦爱人 提交于 2021-01-05 08:52:24
问题 I am trying to implement sorting / filtering on angular material table with formArray as input data source. StackBlits code link dataSource = new MatTableDataSource([]); <table mat-table [dataSource]="formdataarray.controls" multiTemplateDataRows class="mat elevation-z8" matSort > <ng-container matColumnDef="{{column}}" *ngFor="let column of columnsToDisplay" > <th mat-header-cell *matHeaderCellDef mat-sort-header>{{column}}</th> <td mat-cell *matCellDef="let element"> {{ element.value[column

Material-table: How change width of the columns?

梦想与她 提交于 2020-12-15 05:44:17
问题 I'm using the Material Table library that is officially recommended by Google Material UI as a data table library and having troubles with configuring the width of columns. Column width property is working until our content fits the cell: CodeSandbox Is there any solution to fix that? 回答1: If you want to set specific width to each column, I believe that you need to specify the option tableLayout: fixed . The docs refers to it like this: tableLayout | auto or fixed | To make columns width

How to add a fancy scroll-bar on react material-table?

风格不统一 提交于 2020-12-13 03:27:48
问题 I'm using react material-table and want a decent scroll-bar instead of default Pagination. I have tried react-custom-scroll but it's not working as per my intention. The default scroll-bar of my App is activated. One more thing, how can I just apply this type of scroll on just the table body? import CustomScroll from 'react-custom-scroll'; . . . <div style={{height:"50vh"}}> <CustomScroll heightRelativeToParent="100%"> <MaterialTable . . options={{ search: true, paging: false,

How to add a fancy scroll-bar on react material-table?

一曲冷凌霜 提交于 2020-12-13 03:24:05
问题 I'm using react material-table and want a decent scroll-bar instead of default Pagination. I have tried react-custom-scroll but it's not working as per my intention. The default scroll-bar of my App is activated. One more thing, how can I just apply this type of scroll on just the table body? import CustomScroll from 'react-custom-scroll'; . . . <div style={{height:"50vh"}}> <CustomScroll heightRelativeToParent="100%"> <MaterialTable . . options={{ search: true, paging: false,