MedicOneSystems / MedicOneSystems/livewire-datatables

Feature Request: custom export column names

Open
#125 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

I would like to use the label strings with the excel export instead of the datatable join column names.
For this, mainly the function getSelectStatements has to be altered in the when clause at three places:

$column->name

has to be replaced with

$column->label

However, this is not possible directly, as this function is used elsewhere.
For now, I had to override the functions

buildDatabaseQuery, getQuery and export

inside my customized class in order to get to place of usage of getSelectStatements and override it with the needed functionality. Are you able to provide a more convenient way to do this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing getSelectStatements and its callers, especially buildDatabaseQuery, getQuery, and export. Confirm how datatable column names and label strings reach Excel export, then make the export behavior configurable without requiring a customized class to override all three methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.