Answer the question
In order to leave comments, you need to log in
Is it possible to export a field from a kartik grid when using input when displaying data?
There is data output through Kartik-grid .
However, some of the columns use the settings, as in the example below
[
'attribute' => 'email',
'width' => '150px',
'value' => function ($model, $key, $index, $widget) {
return Html::input('text', 'email', $model->email, ['class' => 'kartik-field', 'readonly' => 'readonly']);
},
'format' => 'raw',
],
'value' => function ($model, $key, $index, $widget) {
return Html::input('text', 'email', $model->email, ['class' => 'kartik-field', 'readonly' => 'readonly']) . '<span class="hidden">'.$model->email.'</span>';
},
Answer the question
In order to leave comments, you need to log in
This is not a question for gridview, but for KartikExport. You need to create your own class, inherit from KartikExport and override the methods that cut the input. Haven't dug deep there, but I think he's just trimming the tags.
If so, then theoretically everything is simple, you can insert a span with opacity: 0 next to the input; and data inside.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question