KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Form in Modal #2631

Closed Peter Wendel opened this topic on on Apr 5, 2022 - 1 comments

Peter Wendel commented on Apr 5, 2022

Hi again!

I need a little kick with this resource..

This is the Resource its all about:

<?php

namespace App\KV\Dashboard\Resource;

use App\KV\Dashboard\DataSources\Hm;
use koolreport\dashboard\containers\Html;
use koolreport\dashboard\containers\Modal;
use koolreport\dashboard\containers\Panel;
use koolreport\dashboard\containers\Row;
use koolreport\dashboard\inputs\Button;
use koolreport\dashboard\fields\ID;
use koolreport\dashboard\fields\Number;
use koolreport\dashboard\fields\Text;



class HmFgKtfgDef extends \koolreport\dashboard\admin\Resource
{
    protected function onCreated()
    {
        $this
            ->manageTable("fg_ktfg_def")
            ->inSource(Hm::class)
            ->listScreen()
            ->adminTable()
            ->pageSize(20)
        ;
    }

    protected function query($query)
    {
        return Hm::table('fg_ktfg_def')->orderBy('jahr','desc')->orderBy('kv_quartal','desc');
    }

    protected function fields()
    {
        return [
            Number::create('jahr')->label('Jahr'),
            ID::create('kv_quartal')->label('KV-Quartal')->showOnUpdate(true),
            ID::create('fg')->label('Fachgruppen-ID')->showOnUpdate(true),
            ID::create('ktfg')->label('Kostenträger-FG')->showOnUpdate(true),
            Text::create('fachgruppe')->label('Fachgruppen-Name')
        ];
    }

    protected function highlights()
    {
        return [
            Panel::create()->header('<h4>Tools</h4>')->type('primary')->sub([
                Row::create()->sub([
                    Html::h5('Quartalskonfiguration übertragen.'),
                    Html::p('Die FG/KTFG-Konfiguration wird damit automatisiert z.B. von 20204 nach 20211 übertragen.
                    Veränderte Werte können dann dort editiert werden.'),
                    Button::create()->text('Quartalskonfiguration übertragen')->onClick(function(){ return Modal::show('QEingabe');})
                ]),
                Modal::create('QEingabe')->sub([
                    // Form for getting parameters
                    TextBox::create("qE")->frontText('Blubb')
                ])->title('Quartale auswählen')->showCloseIcon(true)->size("md")->open(false)->animation('fade')
            ])
            ];
    }
}

I decided to get some Parameters from the user for making that "CopyUp-Thing" we dicussed last yesterday. Therefore I let the button open a modal for placing a litte form with two TextBoxes in it and then perfom the submit Action to copy things in the table.

But how do I get a form in there?

Regards, Peter

Peter Wendel commented on Apr 7, 2022

Okay... not solved here, but I did it on another way.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Dashboard