We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Previously thanks for this cool plugin. How to do 'initValueText' on Mr. Karthik's Select2 for Tabular Input.
If we look at these select2, it provides information to search by that model, not models.
`
<?php try { $url = Url::to(['stock-in/find-stock-in-as-list']); // Get the initValueText ??? // Problem $cityDesc = empty($model->stock_in_id) ? '' : StockIn::findOne($model->stock_in_id)->description; echo TabularInput::widget([ 'id' => 'some-id', 'models' => $models, /* lot of configuration */ 'columns' => [ [ 'name' => 'transaction_type_id', 'title' => 'Type', 'enableError' => true, 'type' => Select2::className(), 'options' => [ 'data' => $tt, ] ], [ 'name' => 'stock_in_id', 'title' => $models[0]->getAttributeLabel('stock_in_id'), 'enableError' => true, 'type' => Select2::className(), 'options' => [ 'initValueText' => ???, // set the initial display text 'options' => ['placeholder' => 'Search for a stock in ...'], 'pluginOptions' => [ 'allowClear' => true, 'minimumInputLength' => 3, 'language' => [ 'errorLoading' => new JsExpression("function () { return 'Waiting for results...'; }"), ], 'ajax' => [ 'url' => $url, 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }') ], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(city) { return city.text; }'), 'templateSelection' => new JsExpression('function (city) { return city.text; }'), ], ] ], ], ]); } catch (Exception $e) { echo $e->getMessage() . ' <pre>' . VarDumper::dumpAsString($e->getTraceAsString()) . ' </pre>'; } ?>
Thank you a lot.
The text was updated successfully, but these errors were encountered:
Try this:
[ 'name' => 'stock_in_id', 'title' => $models[0]->getAttributeLabel('stock_in_id'), 'type' => Select2::class, 'options' => [ 'initValueText' => ArrayHelper::map(Stock::find()->all(), 'stock_in_id', 'name'), //'options' => ['placeholder' => 'Search for a stock in ...], ], ]
Sorry, something went wrong.
@ahmadfadlydziljalal I decided to sort out the old issues, so is this issue still relevant or I can just close it?
If you can solved, it will be great! Thks for your time.
No branches or pull requests
Previously thanks for this cool plugin.
How to do 'initValueText' on Mr. Karthik's Select2 for Tabular Input.
If we look at these select2, it provides information to search by that model, not models.
`
`
Thank you a lot.
The text was updated successfully, but these errors were encountered: