我有我的觀點一個卡爾蒂克Yii2預輸入控件:卡爾蒂克Yii2的Widget事先鍵入的內容事件偵聽器不工作
echo \kartik\typeahead\Typeahead::widget([
'name' => 'serial_product',
'options' => [
'placeholder' => 'Product Name/SKU/Serial Number/Coupon Code',
'autofocus' => "autofocus",
'id' => 'serial_product'
],
'scrollable' => TRUE,
'pluginOptions' => [
'highlight' => TRUE,
'minLength' => 3
],
'dataset' => [
[
'remote' => [
'ttl' => 0,
'url' => Url::to(['invoice/ajaxgetinventoryitemsnew']) . '?search=%QUERY',
'ajax' => ['complete' => new \yii\web\JsExpression("function(response){jQuery('#serial_product').removeClass('loading');checkresult(response.responseText);return true}")]
],
'limit' => 10
]
],
'pluginEvents' => [
"typeahead:selected" => "function(obj, item) { checkresult2(item); return true; }",
"typeahead:render" => "function() { console.log('Whatever...'); }",
],
]);
第一個「pluginEvents」(預輸入:選擇)是越來越觸發,因爲它應該。 第二個「typeahead:render」沒有被觸發,並且在控制檯上沒有錯誤。
爲什麼渲染事件沒有被觸發?
版本:typeahead.js 0.10.5 |卡爾蒂克Typeahead.php 1.0.0