• Hello,

    i’m new to tinymce and i have a problem with creating dynamic checkboxes in the popup-menu!
    I want to write a wordpress plugin that shows me all links in a post and each link should be shown in checkbox, so i can do something after they are checked or not. I searched now nearly 2 days for some peace of code to do this but i wasn’t successfull so i hope get some help here or code snipped how i can do that.

    this is my code at the moment.

    (function() {
            tinymce.PluginManager.add('change_link_mce_button', function( editor, url ) {
                editor.addButton('change_link_mce_button', {
                    text: 'Change Link',
                    icon: false,
                    onclick: function() {
                        var arrayLink = Array()
                        var indexLink = 0;
                        var content = editor.getContent();
                        html = jQuery.parseHTML(content);
    
                        jQuery(html).find('a').each(function(){
                            arrayLink[indexLink] = this;
                            indexLink++;
                        });        
    
                        editor.windowManager.open( {
                            title: 'Change Link',
                            body: [
                                {
                                     type: 'checkbox',
                                                                     checked: true,
                                                                     text: 'My checkbox'
                                                            }
                            ],
                            onsubmit: function( e ) {
    
                            }
                        });
                    }
                });
            });
        })();
Viewing 1 replies (of 1 total)
  • Hi,
    I also have same problem can you please let me know how you create dynamic checkbox by opening windowmanager.

    Waiting for appreciate response.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘How do i create Dynamic Checkboxes in tinymce’ is closed to new replies.