CQ5 Dialog in Js

CQ5 code exmaples are rare, so i will post some Javascript Code, that would have helped me a lot. CQ5 is shipped with Ext JS.
See API docs for more options.

var dialog = new CQ.Dialog({
‘width’: 600,
‘modal’: true,
‘resize’: false,
‘title’: ‘My Title’,
‘items’: {
  ‘xtype’: ‘tabpanel’,
  ‘items’:
    [{
      ‘xtype’: ‘panel’,
      ‘title’: ‘Basic’,
      ‘hideMode’: ‘offsets’,
      ‘items’: [
        {
          ‘xtype’: ‘textfield’,
          ‘fieldLabel’: CQ.I18n.get(‘app.components.some.key’),
        },
        //…
      ]
    }]
 },
‘buttons’: [
  {
    ‘text’: ‘Save’,
    ‘handler’: function () {
         //…
    }
  },
  {
    ‘text’: ‘Cancel’,
    ‘handler’: function () {
       this.close();
  }
 }]
}); 


tag

92 Words

2013-02-06 13:55 +0100