admin管理员组

文章数量:1291488

I have 3 sql table.

order: id, order_id, customer_id.

order_item: id, order_id, item_id.

order_item_lot: id, order_id, order_item_id, lot_no, order_qty, available qty.

i want to display sql table data using datatable. i want output like above pic using data table. but i dont know hot to dynamic row span create using yajrabox datatable.

I am working with YajraBox DataTables in Laravel and have three SQL tables: orders, order_item, and order_item_lot. I want to display the data in a single DataTable, grouping data using rowspan. For example, each order_id should span multiple rows for the order_item data, and each order_item should further span rows for order_item_lot.

Here’s what I have tried so far:

  1. I fetched the data using Laravel relationships and eager loading.
  2. I used a nested loop in Blade to render the table data with rowspan dynamically.
  3. I attempted to use JavaScript to merge rows dynamically after the DataTable was initialized.

本文标签: How to add dynamic row span using laravel yajrabox datatableStack Overflow