Problem with partial views and tinymce
In a view (master view) another view is called with $this->load->view(‘sub_view’); In the sub_view i have a texta开发者_StackOverflow中文版rea to use with tinymce.
If I combine the views in one single view and call it from my controller my js works fine and the textarea converts to tinymce editor.
If i use the master - sub scenario and my js targets elements in the sub_view although the same html is returned to the browser js doesn’t fire up correctly and instead of my textarea the whole div that is contained in the sub_view is converted to tinymce. It's like if the contents are loaded afterwards or something.
By the way if i setup just an onclick=alert"()" in the subview it fires up.
Edit: You can grab an example from codeigniter.com/forums/viewthread/179792
Figured it all out. It had nothing to do with either codeigniter or tinymce It was markup error in the main view there was a and the textarea id was also content.
I don't know why it worked correct in full_view In the init it was 'textarea.tinymce' and textarea had class='tinymce' while the div had the same id too but was not a textarea.
but in the sub_view the wrong markup caused errors. Changing ids fixed it Thanks anyone for taking time to review the problem.
精彩评论