YiiBooster
YiiBooster copied to clipboard
query function not defined for Select2 undefined error
Please read this. https://stackoverflow.com/questions/14483348/query-function-not-defined-for-select2-undefined-error
This can be solved in TbSelect2 at line 148 in your Dev branch by adding select before the #{$id} [code] ob_start(); echo "jQuery('select#{$id}').select2({$options})"; foreach ($this->events as $event => $handler) { echo ".on('{$event}', " . CJavaScript::encode($handler) . ")"; } echo $defValue;
Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');
[/code]
This happens when multiple partials are rendered in the same view.
Keep up the very good work Sincerely Babak
@bandpay how to reproduce this ... I have created a page that partially loads two views, each one contains a TbSelect2 widget ... so plz let me know how to see this error
Dear Amr, This one was caused on a form with multiple Select2 and switchGroup elements and the last Select2 won't render.
It was fixed by prepending 'select' to the id of the
I believe that the current version of YiiBooster contains the fix.
Have a nice day :)
Mvh Babak Bandpey
Fra: Amr Bedair Sendt: 06-03-2015 17:05 Til: clevertech/YiiBooster Emne: Re: [YiiBooster] query function not defined for Select2 undefined error (#1001)
@bandpayhttps://github.com/bandpay how to reproduce this ... I have created a page that partially loads two views, each one contains a TbSelect2 widget ... so plz let me know how to see this error
Reply to this email directly or view it on GitHubhttps://github.com/clevertech/YiiBooster/issues/1001#issuecomment-77583796.