Comments (9)
Currently the main idea is that has to be at least one row in list. Your case can be solved the next way:
- add new property e.g.
enableEmptyList
- if this property is true widget will render
add
button in the header of table
New property is necessary for BC. I will try to implement this feature soon or you can prepare PR.
from yii2-multiple-input.
Implemented via dd0d61d
You can update to last revision
Let me know if this is what you wanted
from yii2-multiple-input.
ok, but the + signed wanised... at least in MultipleInput example... with new allowEmptyList property
this example not working
echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
'limit' => 5,
'allowEmptyList' => true,
])
My quick fix:
protected function guessColumns()
{
if (empty($this->columns) && $this->hasModel()) {
$this->columns = [
[
'name' => $this->attribute,
'type' => MultipleInputColumn::TYPE_TEXT_INPUT,
'title' => Inflector::camel2words($this->attribute), // THIS line
]
];
}
}
... but this should working without 'title', too
from yii2-multiple-input.
Ohhh yes, i forgot about this case
from yii2-multiple-input.
fixed via f96092c
from yii2-multiple-input.
Great solution, but the 'title' question isn't solved.
The '+' sign staying there alone, without title, I can't find the proper solution unless the one below.
Probably we need a new property to turn on/off the title and for BC.
(I think we need a title when 'allowEmptyList' is true...)
protected function guessColumns()
{
if (empty($this->columns) && $this->hasModel()) {
$this->columns = [
[
'name' => $this->attribute,
'type' => MultipleInputColumn::TYPE_TEXT_INPUT,
'title' =>$this->model->getAttributeLabel($this->attribute), // recommended line
]
];
}
}
```
from yii2-multiple-input.
Give me an example of code which does not work.
Here is the example without title
<?php
echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
'limit' => 5,
'allowEmptyList' => true
])
->label(false);
?>
from yii2-multiple-input.
It seems that I understood that you propose 😄
But this is another issue. Look at #35
from yii2-multiple-input.
thank you :)
2015-09-15 19:31 GMT+03:00 Eugene Tupikov [email protected]:
It seems that I understood that you propose [image: 😄]
But this is another issue. Look at #35
#35—
Reply to this email directly or view it on GitHub
#34 (comment)
.
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
- add button position POS_ROW_BEGIN is shown under the first column HOT 6
- 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.