Comments (6)
@ritacionfoli post the part of your code (view should be enough) to reproduce the issue. Also, write what version of the widget you use
from yii2-multiple-input.
I'm using the latest version.
This is my view code:
<div class="row">
<?php
echo $form->field($model, 'figli')->widget(MultipleInput::className(), [
'max' => 4,
'id' => 'my_id',
'allowEmptyList' => false,
'addButtonPosition' => MultipleInput::POS_ROW_BEGIN,
'rowOptions' => [
'id' => 'row{multiple_index_my_id}',
],
'columns' => [
[
'name' => 'cognome',
'title' => 'Cognome',
'headerOptions' => ['style' => 'width: 105px']
],
[
'name' => 'nome',
'title' => 'Nome',
'headerOptions' => ['style' => 'width: 105px']
],
[
'name' => 'data_nascita',
'type' => DatePicker::className(),
'title' => 'Nato/a il',
'options' => [
'type' => DatePicker::TYPE_INPUT,
'pluginOptions' => [
'autoclose' => true,
'format' => 'dd/mm/yyyy',
'todayHighlight' => false
],
],
'headerOptions' => ['style' => 'width: 120px']
],
[
'name' => 'luogo_id',
'title' => 'Cod.',
'type' => unclead\multipleinput\MultipleInputColumn::TYPE_HIDDEN_INPUT,
'value' => 0
],
[
'name' => 'luogo',
'title' => 'Luogo nascita',
'type' => \kartik\typeahead\Typeahead::className(),
'headerOptions' => ['style' => 'width: 130px'],
'options' => [
'scrollable' => true,
'dataset' => [
[
'datumTokenizer' => "Bloodhound.tokenizers.obj.whitespace('value')",
'display' => 'value',
'remote' => [
'url' => Url::to(['//mensa/anagrafica/default/comuni-list']) . '?q=%QUERY',
'wildcard' => '%QUERY',
],
'limit' => 10,
]
],
'pluginEvents' => [
"typeahead:selected" => "function(obj, item) {
var id = obj.target.id;
var spli = id.split('-');
var index = spli[2];
$('#signupform-figli-'+index+'-luogo_id').val(item.id);
return true;
}",
"typeahead:render" => "function() {
console.log('Whatever...');
}",
]
]
],
[
'name' => 'cf',
'title' => 'Codice Fiscale',
'options' => ['maxlength' => 16, 'size' => 16, 'minlength' => 16],
'headerOptions' => ['style' => 'width: 100px']
],
[
'name' => 'scuola',
'title' => 'Scuola',
'type' => \kartik\select2\Select2::className(),
'options' => [
'id' => 'parent-{multiple_index_my_id}',
'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP,
'attribute' => 'ID',
'data' => ArrayHelper::map($scuole::find()->all(), 'ID', 'nome'),
],
'headerOptions' => ['style' => 'width: 110px']
],
[
'name' => 'classe',
'title' => 'Classe',
'type' => \kartik\depdrop\DepDrop::className(),
'defaultValue' => 0,
'type' => \kartik\depdrop\DepDrop::TYPE_SELECT2,
'select2Options' => ['pluginOptions' => ['allowClear' => true]],
'pluginOptions' => [
'depends' => ['parent-{multiple_index_my_id}'],
'initialize' => true,
'initDepends' => ['parent-{multiple_index_my_id}'],
'url' => Url::to(['//mensa/users/user/classi']),
'placeholder' => 'Seleziona la classe',
'loadingText' => 'Caricamento classi...',
],
],
'headerOptions' => ['style' => 'width: 70px']
],
[
'name' => 'servizio',
'type' => 'dropDownList',
'title' => 'Servizio',
'defaultValue' => 0,
'items' => [
1 => 'MENSA',
2 => 'SCUOLABUS',
3 => 'MENSA+SCUOLABUS'
],
'options' => [
'onchange' => <<< JS
var id = this.id;
var spli = id.split('-');
var index = spli[2];
if($(this).val()<2)
{
$('#signupform-figli-'+index+'-trasporto').attr("disabled", "disabled");
$('#signupform-figli-'+index+'-fermata').attr("disabled", "disabled");
if($('#delegati').css('display')=="block")
{
var flag = true;
$('td.list-cell__servizio select').each(function() {
if($(this).val()>1)
{flag = false; return true;}
});
if(flag==true){
$('#delegati').css('display', 'none');
}
}
}
else
{
$('#signupform-figli-'+index+'-trasporto').removeAttr("disabled");
$('#signupform-figli-'+index+'-fermata').removeAttr("disabled");
if($('#delegati').css('display')=="none")
{
var flag = true;
$('td.list-cell__servizio select').each(function() {
if($(this).val()<2)
{flag = false; return true;}
});
if(flag==true){
$('#delegati').css('display', 'block');
}
}
}
JS
],
'headerOptions' => ['style' => 'width: 120px']
],
[
'name' => 'trasporto',
'type' => 'dropDownList',
'title' => 'Trasporto',
'defaultValue' => 0,
'items' => [
1 => 'ANDATA+RITORNO',
2 => 'SOLO ANDATA',
3 => 'SOLO RITORNO'
],
'headerOptions' => ['style' => 'width: 120px']
],
[
'name' => 'fermata',
'title' => 'Fermata(se diversa da indirizzo)',
'headerOptions' => ['style' => 'width: 140px']
]
]
])->label(false);
?>
</div>
from yii2-multiple-input.
@ritacionfoli can you also send a screenshot from the Chrome dev tool showing the HTML to ensure that the button is really in the same td
as td
for column cognome
?
from yii2-multiple-input.
from yii2-multiple-input.
Hi, if I modify renderHeader() function from TableRenderer.php with this code before it renders the cells:
if($this->isAddButtonPositionRowBegin()) { $cells[] = $this->renderButtonHeaderCell(); }
the widget renders the table without errors, like below
from yii2-multiple-input.
Related Issues (20)
- Cloning doesn't work for nested MultipleInput
- Add manual for each field for custom tabular input? HOT 4
- Embedded does not work correctly HOT 10
- duplicate keys causing strange behavior HOT 2
- Adding new row with DepDrop suddenly not working.
- Is it possible to keep the selected value of a DepDrop when submit returns error? HOT 1
- wrong version hardcoded in composer.json HOT 1
- render addons in text fields HOT 2
- Html name attribute HOT 2
- all icon missing HOT 7
- Не работает подсветка ошибок при валидации вновь добавленных полей HOT 1
- The array is converted into an object
- Add button not showing in actionUpdate HOT 1
- Can't handle model update HOT 2
- Yii2 advanced template and Bootstrap 5 HOT 1
- Unable to get the file.
- Иногда не обновляется currentIndex после добавления первой строки HOT 3
- Не работает подсветка ошибок если полей более 9 HOT 1
- DateTimePicker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-multiple-input.