Tech TutorBangla Web Documentation
Portfolio
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • TanStack Documentation42টি অধ্যায়
প্রযুক্তি নির্বাচন
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • Project Overview
  • Architecture
  • Folder Structure
  • Setup Next.js
  • Axios Setup
  • API Client
  • API Types
  • Query Install
  • Query Provider
  • Query Keys
  • Data Fetching
  • States
  • Devtools
  • Create Mutation
  • Update Mutation
  • Delete Mutation
  • Cache Invalidation
  • Optimistic Update
  • Pagination
  • Search
  • Filtering
  • Sorting
  • TanStack Table
  • Table Explore
  • Table Columns
  • Table Actions
  • React Hook Form
  • Zod Validation
  • Create Form
  • Edit Form
  • Dialog Modal
  • Delete Confirmation
  • Complete CRUD Flow
  • Full Integration
  • Error Handling
  • Loading States
  • Reusable Components
  • Production
  • Complete Project
  • Common Mistakes
  • Best Practices
  • Interview Q&A
  1. Docs
  2. TanStack
  3. Table Actions — Edit ও Delete row
TanStackIntermediate

Table Actions — Edit ও Delete row

প্রতিটি row-এ action buttons — edit dialog খোলা, delete confirm — বাংলায়।

7টি অংশবাংলা ভাষায়

অ্যাকশন কলামে edit/delete button থাকে যার হুক upstream (dialog state) — তাই এর componentহীণ client-এ اتفق।

Actions cell (inside product-table.tsx)tsx
tsx
import { Pencil, Trash2 } from "lucide-react";
import { Button } from "@/components/ui/button";

interface ProductTableProps {
  data: Product[];
  onEdit: (product: Product) => void;
  onDelete: (product: Product) => void;
}
actions ColumnDeftsx
tsx
{
  id: "actions",
  header: () => <span className="sr-only">Actions</span>,
  cell: ({ row }) => {
    const product = row.original;
    return (
      <div className="flex justify-end gap-1">
        <Button
          variant="ghost"
          size="icon"
          onClick={() => onEdit(product)}
          aria-label={"Edit " + product.name}
        >
          <Pencil className="size-4" />
        </Button>
        <Button
          variant="ghost"
          size="icon"
          onClick={() => onDelete(product)}
          aria-label={"Delete " + product.name}
        >
          <Trash2 className="size-4 text-red-500" />
        </Button>
      </div>
    );
  },
}

কেন id:'actions'

এই column-এর কোনো accessorKey নেই — এটি pure UI. টান-টেবিলে এমন column-এর নাম id: "actions" দেওয়া convention।

Table একসাথে ব্যবহারtsx
tsx
<ProductTable
  data={data}
  columns={productColumns}
  onEdit={(p) => { setEditingProduct(p); setDialogOpen(true); }}
  onDelete={(p) => { setDeletingProduct(p); setDeleteOpen(true); }}
/>
Dialog state-মাত্র upward

এখানে onEdit/onDelete parent-এর state বদলায় — column ও dialog-কে আলাদা রাখা মানে table reusable থাকে (export/mobile view-এ একই column ব্যবহার করা যায়)।

শেষ প্যারায় নিজে practice করুন — কোড কপি করে নিজের এডিটরে চালিয়ে দেখুন।
আগেরTable Columns — DefinitionsপরেরReact Hook Form — Setup
এই পেজে
Tech Tutor

বাংলায় ওয়েব ডেভেলপমেন্ট ডকুমেন্টেশন শিখুন — ধাপে ধাপে।

Homeসব ডকুমেন্টেশনQuick Startআমার নোটস

© 2026 Tech Tutor. বাংলায় শিখুন, বাংলায় গড়ুন।

mdanamolhasan1998@gmail.com