Hello--
I'm trying to set the default value of the "Headers" field in the "Tables Properties" dialog of CKEditor 4.6.3. The Headers field has a list of four values, "None", "First Row", "First Column", and "Both" . I need it to default to "First Row" instead of "None," but I've not found a way to make that happen.
Using guidance found elsewhere in this forum, I am successfully setting the default values of other fields--for example, the default cell padding value:
if ( dialogName == 'table' )
{
// Get a reference to the "Table Info" tab.
var infoTab = dialogDefinition.getContents( 'info' );
txtCellPad = infoTab.get( 'txtCellPad' );
txtCellPad['default'] = '0';
:
:
...but I'm unsure how to change the optional value for a droplist list such as the "Headers" field.
Guidance, please? Thanks--
I'm trying to set the default value of the "Headers" field in the "Tables Properties" dialog of CKEditor 4.6.3. The Headers field has a list of four values, "None", "First Row", "First Column", and "Both" . I need it to default to "First Row" instead of "None," but I've not found a way to make that happen.
Using guidance found elsewhere in this forum, I am successfully setting the default values of other fields--for example, the default cell padding value:
if ( dialogName == 'table' )
{
// Get a reference to the "Table Info" tab.
var infoTab = dialogDefinition.getContents( 'info' );
txtCellPad = infoTab.get( 'txtCellPad' );
txtCellPad['default'] = '0';
:
:
...but I'm unsure how to change the optional value for a droplist list such as the "Headers" field.
Guidance, please? Thanks--
I think this is what you're
I think this is what you're looking for:
CKEDITOR.on( 'dialogDefinition', function( ev ) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if ( dialogName == 'table' )
{
var infoTab = dialogDefinition.getContents('info');
infoTab.get('selHeaders')['default'] = 'row';
}
});
Hope it helps!