Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6784905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:03:28+00:00 2026-05-26T17:03:28+00:00

I have a CKEditor custom plugin I’m trying to write, but need some help

  • 0

I have a CKEditor custom plugin I’m trying to write, but need some help figuring out how to insert the value from a dropdown box for the “active” tab.

I have 4 tabs, each has its own dropdown list. When the user selects the tab, then chooses a value in the dropdown list, and then presses the “OK” button, I want the current value of the “Active tab’s” dropdown list to be inserted into the document.

The code below is working to do this, except I have to hard code the tab I want to get the information from. See: abbr.setText( dialog.getValueOf( 'tab1', 'tenant_dropdown' ) ); of the “onOk” event. I want something more like: abbr.setText( dialog.getValueOf( activeTab, activeElement ) ); or something like this…I couldn’t find the documentation for this…am I daft?

Any ideas how I can accomplish this? Thanks for your help.

Heres my plugin code:

CKEDITOR.plugins.add( 'rz_db',
{   
   requires : ['richcombo'], //, 'styles' ],
   init : function( editor )
   {
        editor.addCommand( 'abbrDialog', new CKEDITOR.dialogCommand( 'abbrDialog' ) );
        editor.ui.addButton( 'Rz Database Field',
                                    {
                                        label: 'Insert Rz Database Field',
                                        command: 'abbrDialog',
                                        icon: this.path + 'images/icon.png'
                                    } );
        CKEDITOR.dialog.add( 'abbrDialog', function ( editor )
        {
            var tenant_fields = []; //new Array();
            tenant_fields[0]=["First Name", "$RZ{tenant_first_name}"];
            tenant_fields[1]=["Last Name", "$RZ{tenant_first_name}"];
            tenant_fields[2]=["Address", "$RZ{tenant_address}"];

            return {
                title : 'Rz Database Fields',
                minWidth : 400,
                minHeight : 200,


                contents :
                [
                    {
                        id : 'tab1',
                        label : 'Tenants',
                        elements :
                        [
                            {
                                id : 'tenant_dropdown',
                                type : 'select',
                                label : 'Select the field you want, then press the "OK" button to insert it into the document.',
                                'default':'',
                                items: tenant_fields,
                                onChange : function( api ) {
                                  // this = CKEDITOR.ui.dialog.select
                                  alert( 'Current value: ' + this.getValue() );
                                }
                            }
                        ]
                    },
                    {
                        id : 'tab2',
                        label : 'Owners',
                        elements :
                        [
                            {
                                type : 'text',
                                id : 'id',
                                label : 'Id'
                            }
                        ]
                    },
                    {
                        id : 'tab3',
                        label : 'Vendors',
                        elements :
                        [
                            {
                                type : 'text',
                                id : 'id',
                                label : 'Id'
                            }
                        ]
                    },
                    {
                        id : 'tab4',
                        label : 'Other',
                        elements :
                        [
                            {
                                type : 'text',
                                id : 'id',
                                label : 'Id'
                            }
                        ]
                    }
                ],

                onOk : function()
                {
                    var dialog = this;
                    var abbr = editor.document.createElement( 'rz_db' );
                    abbr.setText( dialog.getValueOf( 'tab1', 'tenant_dropdown' ) );
                    editor.insertElement( abbr );
                }

            };
        } );
   }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:03:29+00:00Added an answer on May 26, 2026 at 5:03 pm

    never mind…I found a work around. If I set a global variable then assign the value during the “onchange” event and use the global variable in the “onOk” event it gets me what I needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to integrate TinyMCE or CKEditor into Django, but I have no idea
Hi i have created the following ckeditor plugin to insert a youtube video: (function()
I have ckeditor embedded into one of my pages....but I don't know how to
I have to use a ckeditor in my application but I dont know how
I have an instance of CKEditor on a page. I am trying to give
I am trying to add my own custom select menu to the new CKEditor.
I have a Drupal set up with CKEditor and CCK, with a custom node
I have traced the root of this exception to the sourcearea plugin of CKEditor
I have a custom developed CMS where users can enter some content into a
I presently have CKeditor setup on a webpage, but strange things are happening when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.