kartik-v / yii2-widget-typeahead

Enhanced Yii2 wrapper for the Twitter Typeahead plugin (sub repo split from yii2-widgets).
Other
45 stars 17 forks source link

ArrayHelper with Typeahead #13

Closed newerton closed 5 years ago

newerton commented 8 years ago

Follow my code:

$list = ArrayHelper::map(FinancialPay::find()->groupBy('title')->all(), 'id', 'title');
$form->field($model, 'title')->widget(Typeahead::classname(), [
    'pluginOptions' => ['highlight' => true],
    'dataset' => [
        [
            'local' => $list,
            'limit' => 10
        ]
    ]
]);

It is generated:

var kvTypData_8005522d = {"4":"Cartão de Crédito","1":"Supermercado"};

TypeaheadBasic does not happen with this, because it has the function 'array_values' inside the Json::encode(), would like to correct this in TypeaheadBasic too?

Sorry for my English!

stale[bot] commented 5 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.