Hi Matt,
I've tried that but with no luck. Here is my code exactly as it appears.
$(function() {
var myconfig = {
height: '300px',
dompath: true,
focusAtStart: true,
buttons: [
{ group: 'fontstyle', label: 'Text formatting',
buttons: [
{ type: 'push', label: 'Ctrl + Shift + B',
value: 'bold' },
{ type: 'push', label: 'Italic CTRL + SHIFT +
I', value: 'italic' },
{ type: 'push', label: 'Underline CTRL + SHIFT +
U', value: 'underline' },
{ type: 'push', label: 'Subscript', value:
'subscript', disabled: true },
{ type: 'push', label: 'Superscript', value:
'superscript', disabled: true },
{ type: 'color', label: 'Font Color', value:
'forecolor', disabled: true },
{ type: 'color', label: 'Background Color',
value: 'backcolor', disabled: true },
{ type: 'color', label: 'Background Color',
value: 'backcolor', disabled: true }
]
},
{ type: 'separator' },
{ group: 'parastyle', label: 'Paragraph Style',
buttons: [
{ type: 'select', label: 'Normal', value: 'heading',
disabled: true,
menu: [
{ text: 'Normal', value: 'none', checked:
true },
{ text: 'Header 1', value: 'h1' },
{ text: 'Header 2', value: 'h2' },
{ text: 'Header 3', value: 'h3' },
{ text: 'Header 4', value: 'h4' },
{ text: 'Header 5', value: 'h5' },
{ text: 'Header 6', value: 'h6' }
]
}
]
},
{ type: 'separator' },
{ group: 'indentlist', label: 'Indenting and Lists',
buttons: [
{ type: 'push', label: 'Indent', value:
'indent', disabled: true },
{ type: 'push', label: 'Outdent', value:
'outdent', disabled: true },
{ type: 'push', label: 'Create an Unordered
List', value: 'insertunorderedlist' },
{ type: 'push', label: 'Create an Ordered List',
value: 'insertorderedlist' }
]
}
]
};
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;
YAHOO.log('Create the Editor..', 'info', 'example');
var myEditor = new YAHOO.widget.SimpleEditor('editor',
myconfig);
myEditor.render();
});
Here is my html (the textarea part anyway)
<div class="yui-skin-sam">
<textarea name="editor" id="editor" cols="50" rows="10">
</textarea>
</div>
--- In ydn-javascript@yahoogroups.com, "Matt" <matt@...> wrote:
>
> As you've pasted your code, myconfig doesn't exist when you start the
editor and render() it - you only define myconfig afterwards. So the
editor's not going to know anything about the changes you want to make.
>
> Put the var myconfig = ... before the call to
> > var myEditor = new YAHOO.widget.SimpleEditor('editor', myconfig);
> > myEditor.render();
>
> and it should work.
>
> Matt
>
> --- In ydn-javascript@yahoogroups.com, "totalharmonicdistortion"
totalharmonicdistortion@ wrote:
> >
> > Hi,
> >
> > I'm not sure if this is the right place to be posting but here it
goes
> > anyway. I'm happy to move this elsewhere.
> >
> > I'm trying to change the toolbar buttons on the editor widget and I
> > can't seem to get it working.
> >
> > I'm creating the widget like this. Nothing fancy.
> >
> > The toolbar is always rendering the same no matter what I change the
> > button config too. Am I missing a step?
> >
> > Thank you.
> >
> >
> > var myEditor = new YAHOO.widget.SimpleEditor('editor', myconfig);
> > myEditor.render();
> >
> >
> > var myconfig = {
> > height: '300px',
> > dompath: true,
> > focusAtStart: true,
> > buttons: [
> > { group: 'fontstyle', label: 'Text formatting',
> > buttons: [
> > { type: 'push', label: 'Ctrl + Shift + B',
> > value: 'bold' },
> > { type: 'push', label: 'Italic CTRL + SHIFT
+
> > I', value: 'italic' },
> > { type: 'push', label: 'Underline CTRL +
SHIFT +
> > U', value: 'underline' },
> > { type: 'push', label: 'Subscript', value:
> > 'subscript', disabled: true },
> > { type: 'push', label: 'Superscript',
value:
> > 'superscript', disabled: true },
> > { type: 'color', label: 'Font Color',
value:
> > 'forecolor', disabled: true },
> > { type: 'color', label: 'Background Color',
> > value: 'backcolor', disabled: true },
> > { type: 'color', label: 'Background Color',
> > value: 'backcolor', disabled: true }
> > ]
> > },
> > { type: 'separator' },
> > { group: 'parastyle', label: 'Paragraph Style',
> > buttons: [
> > { type: 'select', label: 'Normal', value:
'heading',
> > disabled: true,
> > menu: [
> > { text: 'Normal', value: 'none',
checked:
> > true },
> > { text: 'Header 1', value: 'h1' },
> > { text: 'Header 2', value: 'h2' },
> > { text: 'Header 3', value: 'h3' },
> > { text: 'Header 4', value: 'h4' },
> > { text: 'Header 5', value: 'h5' },
> > { text: 'Header 6', value: 'h6' }
> > ]
> > }
> > ]
> > },
> > { type: 'separator' },
> > { group: 'indentlist', label: 'Indenting and
Lists',
> > buttons: [
> > { type: 'push', label: 'Indent', value:
> > 'indent', disabled: true },
> > { type: 'push', label: 'Outdent', value:
> > 'outdent', disabled: true },
> > { type: 'push', label: 'Create an Unordered
> > List', value: 'insertunorderedlist' },
> > { type: 'push', label: 'Create an Ordered
List',
> > value: 'insertorderedlist' }
> > ]
> > }
> > ]};
> >
>