控件使用小问题

1.select 控件宽度

 用css 对下层样式控制,样式如下:

.prcVariablesSelect .dijitSelectLabel {

    width: 111px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    display: block;

    text-align: left;

}

控件创建:

        this.btnPimsCaseSelect = Dijit.Factory.createSelect({

            id: "abar-caseTools-btnCaseSelect",

            tooltip: resources.shellToolbar.btnPimsCaseSelect,

            title: resources.shellToolbar.btnPimsCaseSelect,

            store: this.viewModel.caseStore,

            labelAttr: 'name',

            sortByLabel: false,

            //searchAttr: "name",

            required: false,

            style: "font-size: 9pt;height:26px;width: 171px;float: left;margin: 0px 0px 0px 0px;",

            maxHeight: '400',//设置下拉框的高度

            query: { name: /.*/ },

            onChange: (e) => {

                this.viewModel.setActiveCase(e, null, this.refreshAll);

            },

        }, Dojo.Dom.create('input'));

2、textbox

Dijit.Factory.createNumberTextBox({

                intermediateChanges: true,

                onChange: (value) => {

            }

            }, td.appendChild(document.createElement("div")));

3、label

 Dojo.Dom.create("div", { innerHTML: "" });

 Dojo.Dom.create("label", {  innerHTML: "Model Tuning", style: ""});

4.icon button 

        Dijit.Factory.createButton({

            iconClass: 'btnPrcDuplicateIcon',

            baseClass: 'iconButtonNoBorder',

            style: "float:right; right: 5px; padding: 5px;"

        });

.iconButtonNoBorder {

    cursor: pointer;

    border: none;

    display: inline-block;

    padding: 0;

    background: none;

}

5、BorderContainer

        this.layoutContainer = Dijit.Factory.createBorderContainer({

            style: 'margin-top: 6px',

        });

6、Dgird

        this.equipmentHierarchyStore = Dojo.Factory.createMemoryStore({

            idProperty: 'id',          

            data: processUnitHeirarchy.internalUnits,

            getChildren: (object: ViewModel.IProcessUnit) => {

                return object.internalUnits.length == 0 ? null : object.internalUnits;

            },

            mayHaveChildren: (object: ViewModel.IProcessUnit) => {

                return object.internalUnits.length > 0;

            }

        });

         dgrid.Factory.createCustomDGridForRowSelection({

            columns: {

                name: dgrid.Factory.createTreeColumn({

                    label: "treeColumnLabel",

                    field: 'name', collapseOnRefresh: true, shouldExpand: function () { return 0; }

                })

            },

            store: new Dojo.Observable(this.equipmentHierarchyStore),

            query: {},

            showHeader: false,

            selectionMode: "single"

        });

7、update later

猜你喜欢

转载自ldaolong.iteye.com/blog/2118318