You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, i have a datatable setup from @shadcn. i've implemented the columns file, and as far as i understand it structures the data for the datatable. I have a "quantities" cell and a "gross profit" cell. The quantities gets added when a user writes the amount in the Input. What i want is for the Input value to be directly transferred to the corresponding cell for Gross profit, so that i can make calculations based on the quantities.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So, i have a datatable setup from @shadcn. i've implemented the columns file, and as far as i understand it structures the data for the datatable. I have a "quantities" cell and a "gross profit" cell. The quantities gets added when a user writes the amount in the Input. What i want is for the Input value to be directly transferred to the corresponding cell for Gross profit, so that i can make calculations based on the quantities.
{ id: "quantity", header: "Quantity", accessorFn: (row) => row.quantity || "", cell: ({ cell, row }) => { const {} = cell.getContext(); return ( <div> <Input value={row.original.quantity} suffix="items" type="number" className="w-[120px]" /> </div> ); }, }, { accessorKey: "gross profit", header: "Gross profit", accessorFn: (row) => { return row.quantity; }, },
Is this possible to achieve?
Beta Was this translation helpful? Give feedback.
All reactions