kartik-v / yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0
http://demos.krajee.com/markdown
Other
89 stars 41 forks source link

Conflict jquery ??? #21

Closed levanlau closed 5 years ago

levanlau commented 10 years ago

Hi, As i have used markdown in ActiveForm as following: echo $form->field($modelCommentProduct, 'comment')->widget( MarkdownEditor::classname(), ['height' => 300, 'encodeLabels' => false] ); and in browser console display an error: Uncaught TypeError: undefined is not a function initEditor (anonymous function) jQuery.event.dispatch elemData.handle

I can not click up any place on markdown editor. Could you please explain me this?Thanks.

kartik-v commented 10 years ago

When are you initializing Jquery? Is it through AppAsset?

levanlau commented 10 years ago

Hi, Thank you for your question. I don't initialize Jquery in AppAsset but I only declare some my own js files in it.

kartik-v commented 10 years ago

You need to initialize JQuery by including YiiAsset in depends of AppAsset. Check the default advanced or basic app for this.

levanlau commented 10 years ago

Yes,including YiiAsset in depends of AppAsset is default,I have made it already public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapAsset', ]; What else must i include ?

edvardpotter commented 6 years ago

I also get a similar error: https://stackoverflow.com/questions/37738732/jquery-3-0-url-indexof-error How can I fix this?

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.