demogorgorn / yii2-ajax-submit-button Goto Github PK
View Code? Open in Web Editor NEWOld good ajax submit button from Yii 1 for Yii 2
Old good ajax submit button from Yii 1 for Yii 2
"demogorgorn/yii2-ajax-submit-button": "*"
composer gets message: could not to be any version
with "demogorgorn/yii2-ajax-submit-button": "dev-master" composer install yii2-ajax-submit-button normaly.
Im trying to use it on a form that has file upload widget, all the thing that goes with $_POST are saved, but the $_FILES appear to empty.
It would be nice to have an optional confirmation alert before the ajax request is submitted, similar to the trash button in the yii2 grid widget.
hint: add support to encodeLabels, kind regards;
if (isset($item['encodeLabels'])) {
$this->encodeLabels = $item['encodeLabels'];
}
Добрый день, отличная штука, все работает, есть момент - как вызвать событие до отправки данных, то есть как бы показать прелодер, а после загрузки его убрать (убрать знаю как)
На каждую форму грузит заново jquery, как добавить зависимость?
I am facing problem in rendering AjaxSubmitButton in Gridview.
It should be on location 1 but i comes on location2.
Following is my code.
`[
'format'=>'html',
'value'=> function() {
AjaxSubmitButton::begin([
'label' => 'Check',
'ajaxOptions' => [
'type' => 'POST',
'url' => 'country/getinfo',
/'cache' => false,/
'success' => new \yii\web\JsExpression('function(html){
$("#output").html(html);
}'),
],
'options' => ['type' => 'submit'],
]);
AjaxSubmitButton::end();
}
I am using an active form based on a model and want to submit this via Ajax. The view code basically looks like this:
<?php $clubForm = ActiveForm::begin([
'action' => Url::to(['club/ajax-create']),
]); ?>
<?= $clubForm->field($clubModel, 'name')->textInput(['maxlength' => 150]) ?>
<?= $clubForm->field($clubModel, 'nation')->dropDownList(
ArrayHelper::map(Nation::find()->all(), 'id', 'name')
) ?>
<div class="form-group">
<?php AjaxSubmitButton::begin([
'label' => 'Speichern',
'id' => 'saveClubButton',
'ajaxOptions' => [
'type' => 'POST',
'url' => Url::to(['club/ajax-create']),
'success' => new \yii\web\JsExpression('saveCreatedClub(result)'),
],
'options' => ['class' => 'btn btn-success', 'type' => 'submit'],
]);
AjaxSubmitButton::end();
?>
</div>
<?php ActiveForm::end(); ?>
However, pressing the button causes the form to perform a POST request, and the page is reloaded, instead if an AJAX request. (Action is the page where the widget is used).
Наблюдается проблема. Когда через pjax релодится плагин, то кнопка перестает работать.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.