要禁止在dojo gridx的ColumnResizer结构中拖动扩大列宽,可以通过设置resizable属性为false来实现。具体代码示例如下:

var grid = new Grid({
    id: 'grid',
    store: store,
    structure: [
        {id: 'id', field: 'id', name: 'ID', width: '50px', resizable: false},
        {id: 'name', field: 'name', name: 'Name', width: '100px', resizable: false},
        {id: 'age', field: 'age', name: 'Age', width: '50px', resizable: false},
        {id: 'gender', field: 'gender', name: 'Gender', width: '50px', resizable: false}
    ],
    modules: [
        ColumnResizer
    ]
}, 'gridContainer');

在上面的代码中,设置了每个列的resizable属性为false,这样就禁止了用户通过拖动来扩大列宽


原文地址: https://www.cveoy.top/t/topic/fspo 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录