1 | // Note: This automatic widget to dialog window binding (the fact that every field is set up from the widget |
---|
2 | // and is committed to the widget) is only possible when the dialog is opened by the Widgets System |
---|
3 | // (i.e. the widgetDef.dialog property is set). |
---|
4 | // When you are opening the dialog window by yourself, you need to take care of this by yourself too. |
---|
5 | |
---|
6 | CKEDITOR.dialog.add( 'contentTable', function( editor ) { |
---|
7 | return { |
---|
8 | title: 'Conten Table', |
---|
9 | minWidth: 200, |
---|
10 | minHeight: 100, |
---|
11 | contents: [ |
---|
12 | { |
---|
13 | id: 'info', |
---|
14 | elements: [ |
---|
15 | { |
---|
16 | id: 'rows', |
---|
17 | type: 'text', |
---|
18 | label: 'Rows', |
---|
19 | width: '50px', |
---|
20 | // When setting up this field, set its value to the "align" value from widget data. |
---|
21 | // Note: Align values used in the widget need to be the same as those defined in the "items" array above. |
---|
22 | setup: function( widget ) { |
---|
23 | this.setValue( widget.data.rows ); |
---|
24 | }, |
---|
25 | // When committing (saving) this field, set its value to the widget data. |
---|
26 | commit: function( widget ) { |
---|
27 | widget.setData( 'rows', this.getValue() ); |
---|
28 | } |
---|
29 | }, |
---|
30 | { |
---|
31 | id: 'columns', |
---|
32 | type: 'text', |
---|
33 | label: 'Columns', |
---|
34 | width: '50px', |
---|
35 | setup: function( widget ) { |
---|
36 | this.setValue( widget.data.columns ); |
---|
37 | }, |
---|
38 | commit: function( widget ) { |
---|
39 | widget.setData( 'columns', this.getValue() ); |
---|
40 | } |
---|
41 | } |
---|
42 | ] |
---|
43 | } |
---|
44 | ] |
---|
45 | }; |
---|
46 | } ); |
---|