contributte / forms-multiplier

:repeat: Form multiplier & replicator for Nette Framework

Home Page:https://contributte.org/packages/contributte/forms-multiplier.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ajaxification

martypala opened this issue · comments

Is there some way how to ajaxify adding/removing of rows?

This could help

			$multiplier->addRemoveButton(null, function (SubmitButton $submitter) {
				$submitter->onClick[] = function () {
				        // redraw snippet
				};
				$submitter->setHtmlAttribute('class', 'ajax');
			});

throws MemberAccessException: Cannot read an undeclared property Nette\Forms\Controls\SubmitButton::$onSubmit.

Yeah sorry, I mean onClick. Edit the code

Not working, ajax css class is not appended to html element
$itemsMultiplier->addRemoveButton('Smazat', function (Nette\Forms\Controls\SubmitButton $submitter) { $submitter->onClick[] = function () { $this->redrawControl('variantsCont'); }; $submitter->setHtmlAttribute('class', 'ajax'); });

If you use manual render you must add class into a template.

OK, now it working. Ajaxified adding/removing of rows. Thanks! Díky :)