MedicOneSystems / MedicOneSystems/livewire-datatables

Passing param from blade to be used as a link var.

Open
#442 0 comments 0 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've run into an issue that may be solvable with the exsisting infrastructure but I don't readily see how to do this.

I have a List of IDs and Names that I have working with the datatable along with a Unrelated ID that i need to pass into the link so that I can add the proper record.

For example:

I am at a customer screen with ID 000001 which is the customer ID. I am showing a list of potential contacts I would like to associate with this customer from a link in a datatable with just columns of the contacts. How might be the cleanest way to get the customer ID on the link inside the datatable?

I was able to do something like this below which got me 90% there, then I realize the link builder only allows named columns.

In the columns table class:

(new LabelColumn()) ->label('Customer ID') ->content($this->params),

And in the blade file

<livewire:my.datatables.assign-contact-customer-table :params="$customer->cus_id">

This does work to the point of getting the customer id on the datatable but there is no way to use the param in the link I can see.

TIA

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 with the columns table class and the Blade entry point shown in the issue, including the livewire:my.datatables.assign-contact-customer-table component and its params value. Trace how the datatable link builder handles columns, then determine how the customer ID can reach the generated link; done when the contact link includes the correct customer ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.