2017-07-04 3 views
0

Für diese checkboxgroups - Unaligned checkboxesAusrichten verschiedenen Checkbox Gruppen

Ich möchte, um sie auszurichten, wie diese checkboxgroups aussehen - Aligned checkboxes

Der folgende Code ist, was ich habe bisher

{ 
     xtype: 'fieldset', 
     title: 'Add to Descriptors', 
     items: [ 
      { 
       xtype: 'checkboxgroup', 
       items: [ 
        {boxLabel: '1.1', name: ''}, 
        {boxLabel: '1.2', name: ''}, 
        {boxLabel: '1.3', name: ''}, 
        {boxLabel: '1.4', name: ''}, 
        {boxLabel: '1.5', name: ''}, 
        {boxLabel: '1.6', name: ''} 
       ] 
      }, 
      { 
       xtype: 'checkboxgroup', 
       items: [ 
        {boxLabel: '2.1', name: ''}, 
        {boxLabel: '2.2', name: ''}, 
        {boxLabel: '2.3', name: ''}, 
        {boxLabel: '2.4', name: ''}, 
        {boxLabel: '2.5', name: ''}, 
        {boxLabel: '2.6', name: ''} 
       ] 
      } 
     ] 
} 

Was muss hinzugefügt werden?

+0

Ihre Bilder sind nicht zugänglich geben sein. Können Sie es bitte überprüfen. Erstellen Sie eine Geige, wenn möglich. – UDID

+0

Hmmm, das ist seltsam, nicht sehen, warum sie nicht sein würden. – DeputyDildog

+0

Ja jetzt kann ich sehen. – UDID

Antwort

1

Denn es zu erreichen, müssen Sie feste Breite für alle Kontrollkästchen und das Layout sollte hbox

Ext.application({ 
 
    name: 'Fiddle', 
 
    launch: function() { 
 
    Ext.create('Ext.form.Panel', { 
 
     title: 'Checkbox Group', 
 

 
     bodyPadding: 10, 
 
     renderTo: Ext.getBody(), 
 
     items: [{ 
 
     xtype: 'fieldset', 
 
     title: 'Add to Descriptors', 
 
     items: [{ 
 
      xtype: 'checkboxgroup', 
 
      layout: 'hbox', 
 
      defaults: { // defaults are applied to items, not the container 
 
       width: 75 
 
      }, 
 
      items: [{ 
 
       boxLabel: '1.1', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '1.2', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '1.3', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '1.4', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '1.5', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '1.6', 
 
       name: '' 
 
       } 
 
      ] 
 
      }, 
 
      { 
 
      xtype: 'checkboxgroup', 
 
      layout: 'hbox', 
 
      defaults: { // defaults are applied to items, not the container 
 
       width: 75 
 
      }, 
 
      items: [{ 
 
       boxLabel: '2.1', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '2.2', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '2.3', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '2.4', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '2.5', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '2.6', 
 
       name: '' 
 
       } 
 
      ] 
 
      }, 
 

 
      { 
 
      xtype: 'checkboxgroup', 
 
      layout: 'hbox', 
 
      defaults: { // defaults are applied to items, not the container 
 
       width: 75 
 
      }, 
 
      items: [{ 
 
       boxLabel: '3.1', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '3.2', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '3.3', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '3.4', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '3.5', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '3.6', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '3.7', 
 
       name: '' 
 
       } 
 
      ] 
 
      }, 
 
      { 
 
      xtype: 'checkboxgroup', 
 
      layout: 'hbox', 
 
      defaults: { // defaults are applied to items, not the container 
 
       width: 75 
 
      }, 
 
      items: [{ 
 
       boxLabel: '4.1', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '4.2', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '4.3', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '4.4', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '4.5', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '4.6', 
 
       name: '' 
 
       } 
 
      ] 
 
      }, 
 
      { 
 
      xtype: 'checkboxgroup', 
 
      layout: 'hbox', 
 
      defaults: { // defaults are applied to items, not the container 
 
       width: 75 
 
      }, 
 
      items: [{ 
 
       boxLabel: '5.1', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '5.2', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '5.3', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '5.4', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '5.5', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '5.6', 
 
       name: '' 
 
       } 
 
      ] 
 
      }, 
 
      { 
 
      xtype: 'checkboxgroup', 
 
      layout: 'hbox', 
 
      defaults: { // defaults are applied to items, not the container 
 
       width: 75 
 
      }, 
 
      items: [{ 
 
       boxLabel: '6.1', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '6.2', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '6.3', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '6.4', 
 
       name: '' 
 
       }, 
 
       { 
 
       boxLabel: '6.5', 
 
       name: '' 
 
       }, 
 
      ] 
 
      }, 
 
     ] 
 
     }] 
 
    }); 
 
    } 
 
});
<link rel="stylesheet" href="https://cdn.sencha.com/ext/gpl/4.1.1/resources/css/ext-all.css"> 
 
<script type="text/javascript" src="https://cdn.sencha.com/ext/gpl/4.1.1/ext-all-debug.js"></script>

+0

Das hat funktioniert! Vielen Dank. – DeputyDildog

Verwandte Themen