Set/get container values on add/delete

Aperta
#113 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

The issue names no files or tests. Start by tracing the addCreateButton and addRemoveButton callback APIs, then identify how container values and indexes are represented; done means the supported API can set values for a new container and retrieve the removed container's values or index.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

question

Hello,
I am using the callbacks for the create and remove buttons. I want to add a new container with specific values and be able to retrieve the values of the removed container or at least its index.

        $multiplier->addSelect('select_item');
        $multiplier->addCreateButton('Add')
            ->addOnCreateCallback(function (Contributte\FormMultiplier\Submitter $submitter) {
                $submitter->onClick[] = function () use ($submitter): void {
                    $itemId = $submitter->parent['select_item']->getRawValue();
                    if ($itemId) {
                        $item = $this->getItem($itemId);

                        // Set item values to new container

                    }
                    $this->redrawControl('formContainer');
                    $this->redrawControl('form');
                };
            });
        $multiplier->addRemoveButton('Remove')
            ->addOnCreateCallback(function (SubmitButton $submitter) {
                $submitter->onClick[] = function () use ($submitter) {

                    // Get index/values of removed container

                    $this->redrawControl('formContainer');
                    $this->redrawControl('form');
                };
            }); 

Can you please help me on that? Thank you in advance.

Lingua principale
PHP
Stelle
29
Fork
20
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di contributte/forms-multiplier

Tutte le issue di contributte/forms-multiplier

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.