问题
I need a drop down submenu list within the drop down menu list in plugin. but problem is, that menu shows that It has drop down submenu list but contents of list are not being loaded. empty submenu is shown.
Snap shot:

code :
CKEDITOR.plugins.add( 'microdata',
{
requires : [ 'styles', 'button' ],
init : function( editor )
{
var markup= editor.config.languages,
items = {};
for ( var i = 0 ; i < markup.length ; i++ )
{
var parts = markup[i].split( '=' );
var name= parts[1].split('org/');
items[ parts[ 0 ] ] =
{
label : parts[ 0 ],
group : 'microdata',
icon: this.path + 'icon1.png' ,
order : i,
getItems: function()
{
var selection = editor.getSelection();
return {
name: CKEDITOR.TRISTATE_OFF,
friend: CKEDITOR.TRISTATE_OFF
};
}
};
var name=
{
label: 'name',
group: 'microdata',
//command: 'nameCmd',
order: 5
}
editor.addMenuGroup( 'microdata' );
editor.addMenuItems( items,name);/*,
friend:
{
label: 'friend',
group: 'microdata',
//command: 'friendCmd',
order: 10
}
);*/
editor.ui.add( 'Microdata', CKEDITOR.UI_MENUBUTTON,
{
label: 'Microdata',
command: 'Microdata',
modes : { wysiwyg:1 },
className : 'cke_button_microdata',
icon: this.path + 'icon1.png' ,
onMenu : function()
{
var activeItems = {};
for ( var prop in items )
{
if ( items.hasOwnProperty( prop ) )
activeItems[ prop ] = CKEDITOR.TRISTATE_ON;
}
return activeItems;
}
} );
}
} );
CKEDITOR.config.languages = [ 'Place=http://schema.org/Place'];
Commands are not added yet.
Any help is greatly appreciated.
来源:https://stackoverflow.com/questions/16197948/ckeditor-submenu-drop-downlist-not-appearing