kartik-v / yii2-builder

Build forms (single or tabular) easily for Yii Framework 2.0.
http://demos.krajee.com/builder
Other
100 stars 50 forks source link

Tabularform / fieldConfig attribute #131

Closed ghost closed 3 years ago

ghost commented 7 years ago

Hi Kartik,

I have an attribute and I would like to append a content after this attribute. The append content is not appeared in price input. What could be the problem?

$attributes = [
  'price' => [
    'type' => TabularForm::INPUT_TEXT,
    'label' => Yii::t('app', 'Price'),
    'fieldConfig' => [
      'addon' => [
        'append' => ['content' => Yii::$app->formatter->currencyCode]
      ]
    ],
  ],
];

echo TabularForm::widget([
    'dataProvider' => $dataProvider,
    'formName' => 'PPrice',
    'checkboxColumn' => false,
    'actionColumn' => false,
    'attributes' => $attributes,
    'gridSettings' => [
        'panel' => [
            'heading' => false,
            'type' => GridView::TYPE_DEFAULT,
            'before' => false,
            'footer' => false,
            'after' => Html::button(Icon::show('plus') . Yii::t('app', 'Add'), ['type' => 'button', 'class' => 'btn btn-success kv-batch-create', 'onClick' => 'addRowPPrice()']),
        ]
    ]
]);
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/50901499-tabularform-fieldconfig-attribute?utm_campaign=plugin&utm_content=tracker%2F776156&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F776156&utm_medium=issues&utm_source=github).
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.