import { createMuiTheme, FormControlLabel, Input, MuiThemeProvider, Paper, TableCell, Typography } from '@material-ui/core' import MUIDataTable from 'mui-datatables' import React, { Component } from 'react' var ct = require("../../library/CustomTable"); const getMuiTheme = () => createMuiTheme(ct.customTable3()); const options = ct.customOptionsFixedColumn(); const style = { position: "sticky", left: 0, zIndex: 101, background: "white", }; const style2 = { position: "sticky", background: "white", zIndex: 100 }; const stylenotes = { position: "sticky", background: "white", zIndex: 101, left: 350 }; const styleNotesEmpty = { position: "sticky", background: "white", zIndex: 99, left: 0 } export default class ProfitLossRO extends Component { render() { let dataTable = [ ["Ravenue", "", {a: "1"}, {b: "2"}, {c: "3"}, {d: "4"}, {e: "5"}, {f: "6"}, {g: "7"}, {h: "8"}, {i: "9"}, {j: "10"}, {k: "11"}, {l: "13"}, {m: "14"}, {n: "15"}], ["Total Assets", "", {a: "1"}, {b: "2"}, {c: "3"}, {d: "4"}, {e: "5"}, {f: "6"}, {g: "7"}, {h: "8"}, {i: "9"}, {j: "10"}, {k: "11"}, {l: "13"}, {m: "14"}, {n: "15"}] ] const handleNotes = (value, tableMeta) => { // console.log(value) let a = dataTable[tableMeta.rowIndex][tableMeta.columnIndex] = value // console.log(dataTable2[tableMeta.rowIndex]); } let columns = [{ name: "Account", options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style }), customBodyRender: (val, tableMeta) => { return (
{val}
) } } }, { name: "Notes", options: { customHeadRender: (columnMeta) => ( dataTable.length > 0 ? {columnMeta.name} : {columnMeta.name} ), setCellProps: () => ({ style: { position: "sticky", background: "white", zIndex: 101, left: 350 } }), customBodyRender: (value, tableMeta, updateValue) => { return (
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null : { // updateValue(event.target.value) handleNotes(event.target.value, tableMeta) // console.log(dataTable2) }} /> } />}
) } } }, { name: `31 Dec 2020 Actual`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.a}
) } } }, { name: `Jan 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.b}
) } } }, { name: `Feb 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.c}
) } } }, { name: `Mar 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.d}
) } } }, { name: `Apr 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.e}
) } } }, { name: `May 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.f}
) } } }, { name: `Jun 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.g}
) } } }, { name: `Jul 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.h}
) } } }, { name: `Aug 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.i}
) } } }, { name: `Sep 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.j}
) } } }, { name: `Oct 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.k}
) } } }, { name: `Nov 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.l}
) } } }, { name: `Dec 2021`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.m}
) } } }, { name: `2021 Outlook`, options: { customHeadRender: (columnMeta) => ( {columnMeta.name} ), setCellProps: () => ({ style2 }), customBodyRender: (value, tableMeta, updateValue) => { return (
{value.n}
) } } }, ] return (
Rolling Outlook & Revision CAT
Rolling Outlook - Profit Loss
Company Name Period : 2020 rev.1 in IDR mn
) } }