---
title: "Sencha Architect 2 中无法添加 buttons 属性的问题。"
author: "topcss"
date: "2012-08-03T18:10:12Z"
tags: []
categories: ["Web前端"]
slug: "sencha-architect-2-buttons"
draft: false
lastmod: "2012-08-03T18:10:12Z"
id: 1618556
url: "https://topcss.iteye.com/blog/1618556"
---

Sencha Architect 2 中无法添加 buttons 属性的问题。

 

解决步骤：

1、通过google 传送到

http://www.sencha.com/forum/showthread.php?178952-Ext.form.Panel-misses-buttons-config

 

文中提到API有解决方法，于是在传送到

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.panel.Panel-cfg-buttons

 

核心方法：添加 toolbar 的 ui: 'footer' 属性

```
buttons: [
  { text: 'Button 1' }
]
```

 相当于

```
dockedItems: [{
    xtype: 'toolbar',
    dock: 'bottom',
    ui: 'footer',
    defaults: {minWidth: minButtonWidth},
    items: [
        { xtype: 'component', flex: 1 },
        { xtype: 'button', text: 'Button 1' }
    ]
}]
```