Dynamický formulářová tabulka – zpracování dat
- Fires
- Člen | 97
Zdravím, přečetl jsem snad vše co se dalo ale odpověď jsem nenašel. Mám tabulku která obsahuje data(formulář který se JS rozšiřuje, upravuje), ale nevím jak se dostat k datům. Respektive post metoda a vše se zavolá ale data jsou prázdná .. Napadá Vás čím to ?
SABLONA
<form action="{plink ControlMapsFormSubmit!}" method="post">
<table class="table table-striped table-dark">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Ident</th>
<th scope="col">Title</th>
<th scope="col">Actions <button type="button" class="btn btn-success btn-sm ml-3 float-right"> Add room</button> <input type="submit" class="btn btn-info btn-sm float-right ml-3" value="Submit Button"></th>
</tr>
</thead>
<tbody>
{foreach $controlMaps as $controlMap}
<tr id="mapEdit{$controlMap->id}Row">
<th scope="row"><input class="form-control" type="text" value="{$controlMap->id}" readonly></th>
<td><input class="form-control editable_input" type="text" value="{$controlMap->ident}" readonly></td>
<td><input class="form-control editable_input" type="text" value="{$controlMap->title}" readonly></td>
<td>
<button type="button" class="btn btn-success btn-sm config_hide" data-target="#mapEdit{$controlMap->id}">Edit map</button>
<button type="button" class="btn btn-danger btn-sm">Delete</button>
</td>
</tr>
<tr style="display:none" id="mapEdit{$controlMap->id}">
<td colspan="4">
<label for="controlMapCode{$controlMap->id}">Map code</label>
<textarea class="form-control" id="controlMapCode{$controlMap->id}" rows="4">{$controlMap->map_code}</textarea>
</td>
</tr>
{/foreach}
</tbody>
</table>
</form>
ZPRACOVANI
public function handleControlMapsFormSubmit($data){
$data = $this->getHttpRequest();
\Tracy\Debugger::barDump($data);
}
VYSLEDEK
Nette\Http\Request #9e41
method private => "POST" (4)
url private => Nette\Http\UrlScript #b19c
post private => array ()
files private => array ()
cookies private => array (1)
PHPSESSID => "a366b9b17tocil7gi00ur96k81" (26)
headers private => array (13)
remoteAddress private => "::1" (3)
remoteHost private => null
rawBodyCallback private => Closure #2e93
file => "C:\wamp64\www\projectglobe\vendor\nette\http\src\Http\RequestFactory.php" (72)
line => 276
variables => array ()
parameters => ""
- Ondřej Kubíček
- Člen | 494
měl bys to spíš řešit klasicky přes nette formuláře a multiplier, je na to dobrá knihovna https://componette.org/…-multiplier/