Open dottharun opened 5 months ago
import { ResponsiveDataTable } from "@layer5/sistent";
function App() { const columns = [ { name: "name", label: "Name" }, { name: "company", label: "Company" }, { name: "city", label: "City" }, { name: "state", label: "State" }, ];
const data = [ ["Joe James", "Test Corp", "Yonkers", "NY"], ["John Walsh", "Test Corp", "Hartford", "CT"], ["Bob Herm", "Test Corp", "Tampa", "FL"], ["James Houston", "Test Corp", "Dallas", "TX"], ];
const colVis = { name: true, company: false, city: true, state: true };
return ( <> <ResponsiveDataTable data={data} columns={columns} columnVisibility={colVis} /> </> ); }
export default App;
![image](https://github.com/layer5io/sistent/assets/80959679/7cac54da-e3fe-4c52-8d5a-f4376848c986) - From the [implementation](https://github.com/layer5io/sistent/blob/44eb9698d484b4904e0ecc0e0056103cd8bcf0a3/src/custom/ResponsiveDataTable.tsx#L29) `tableCols` prop seems to be required to render the Table. - Even with `tableCols` prop, `columnVisibility` seems to be ignored. ```tsx import { ResponsiveDataTable } from "@layer5/sistent"; function App() { const columns = [ { name: "name", label: "Name" }, { name: "company", label: "Company" }, { name: "city", label: "City" }, { name: "state", label: "State" }, ]; const data = [ ["Joe James", "Test Corp", "Yonkers", "NY"], ["John Walsh", "Test Corp", "Hartford", "CT"], ["Bob Herm", "Test Corp", "Tampa", "FL"], ["James Houston", "Test Corp", "Dallas", "TX"], ]; const colVis = { name: true, company: false, city: true, state: true }; return ( <> <ResponsiveDataTable data={data} tableCols={columns} //should be optional columns={columns} columnVisibility={colVis} /> </> ); } export default App;
columns
tableCols
columnVisibility
Hii ! I would like to work on this !
@dottharun Can I work on this if it is not assigned to @MrPhenomenal3110 ?
Current Behavior
function App() { const columns = [ { name: "name", label: "Name" }, { name: "company", label: "Company" }, { name: "city", label: "City" }, { name: "state", label: "State" }, ];
const data = [ ["Joe James", "Test Corp", "Yonkers", "NY"], ["John Walsh", "Test Corp", "Hartford", "CT"], ["Bob Herm", "Test Corp", "Tampa", "FL"], ["James Houston", "Test Corp", "Dallas", "TX"], ];
const colVis = { name: true, company: false, city: true, state: true };
return ( <> <ResponsiveDataTable data={data} columns={columns} columnVisibility={colVis} /> </> ); }
export default App;
Expected Behavior
columns
,tableCols
,columnVisibility
, Correct the implementation/readme to reflect correct behaviour.Screenshots/Logs
Environment
Contributor Guides and Resources