0
我想更改通過dgrid/editor插入到OnDemandGrid中的窗口小部件的寬度。模板文件通過調用this.ruleLinesColumns()
來設置列,該列返回函數返回的列。我通過下面的代碼將dgrid/editor插件插入列中。默認情況下,小部件的寬度設置爲比列寬寬很多。我想將其設置爲100%,以便它適合列,而不是通過它。如何更改OnDemandGrid中的窗口小部件的寬度
這裏是我的文件:
模板文件
<div data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region: 'center', gutters: false">
<div data-dojo-type="dgrid/OnDemandGrid"
data-dojo-mixins="dgrid/Selection, dgrid/extensions/DijitRegistry, prophet/common/dgrid/_StandardGridMixin, prophet/common/dgrid/_TreeRowHighlightingMixin"
data-dojo-attach-point="ruleLinesGrid"
data-dojo-props="'class': 'grid',
store: this.ruleLinesStore,
columns: this.ruleLinesColumns(),
sort: 'sequence',
selectionMode: 'single',
deselectOnRefresh: false">
</div>
</div>
當我設置列
ruleLinesColumns: function() {
var self = this;
return [
...
editor({
field: "training",
label: msgs.editor.training,
sortable: false,
required: true,
autoSave: true
}, NumberTextBox),
...
];
},
我已經嘗試了幾種不同的東西,例如包括style: {width: '100%'}
和width: '100%'
但似乎沒有任何工作。
這裏的文檔dgrid /編輯: https://github.com/SitePen/dgrid/blob/master/doc/components/mixins/Editor.md