Moved domain to start of column

This commit is contained in:
pepper committed 2021-01-24 17:55:40 -05:00
1 parent c1e3d30294
commit 6f4981699e
1 file changed
+14 -7
+14 -7
View File
@@ -6,6 +6,7 @@ import filterFactory from "react-bootstrap-table2-filter";
import ToolkitProvider, {
Search,
CSVExport,
ColumnToggle,
} from "react-bootstrap-table2-toolkit";
// Main table for the Historical migrations tab,
@@ -77,7 +78,18 @@ const CompTable = (props) => {
sizePerPageRenderer, // A numeric array is also available. the purpose of above example is custom the text
};
const columns = [
const updateCol = () => {
console.log(columns[0].hidden);
columns[0].hidden = true;
console.log(columns[0].hidden);
};
let columns = [
{
dataField: "domain",
text: "Domain",
sort: true,
formatter: (cell, row) => <a href={"migrations/" + row.id}> {cell} </a>,
},
{ dataField: "id", text: "ID", hidden: true },
{ dataField: "brand", text: "Brand", sort: true },
{ dataField: "migration_status", text: "Status", sort: true },
@@ -108,12 +120,6 @@ const CompTable = (props) => {
},
{ dataField: "booked_date", text: "Booked Date", sort: true },
{ dataField: "agent_booked", text: "Agent initials", sort: true },
{
dataField: "domain",
text: "Domain",
sort: true,
formatter: (cell, row) => <a href={"migrations/" + row.id}> {cell} </a>,
},
{ dataField: "additional_domains", text: "Additional Domains", sort: true },
{ dataField: "username", text: "Username", sort: true },
{ dataField: "migration_type", text: "Type", sort: true },
@@ -128,6 +134,7 @@ const CompTable = (props) => {
return (
<div>
<button onClick={updateCol}>Test</button>
{loading ? (
<ToolkitProvider
keyField="name"