Stopping columns resizable in jqgrid

后端 未结 2 1588
渐次进展
渐次进展 2020-11-22 02:06

How I can make all the columns of jqgrid not resizable? Currently I think every column I\'ve to specify the property { resizable:false }. Is there anyway I can specify for t

2条回答
  •  借酒劲吻你
    2020-11-22 02:31

    Template works great for me:

     { name: 'quantity_warehouse', index: 'quantity_warehouse', template: intColTemplate, width: '70' },
    
     { name: 'status', index: 'status', align: 'left', template: stringColTemplate, width: '90' },
    
     { name: 'snapshot_at', index: 'snapshot_at', template: dateColTemplate },
    
     { name: 'applied_at', index: 'applied_at', template: dateColTemplate },
    

    JS:

    var dateColTemplate = { align: 'left', search: true, stype: 'text', width: '70', datefmt: 'm/d/y', formatter: 'date', formatoptions: { srcformat: 'm/d/y', newformat: 'm/d/Y' }, sorttype: 'date', searchrules: { required: true, date: true }, searchoptions: { sopt: ['eq', 'ge', 'le'],
    
        dataInit: function (el) {
            $(el).datepicker({ changeYear: true, changeMonth: true, showButtonPanel: true });
        }
    }
    };
    var intColTemplate = { align: 'left', search: true, stype: 'text', searchoptions: { sopt: ['eq', 'ge', 'le']} };
    var stringColTemplate = { align: 'left', search: true, stype: 'text', searchoptions: { sopt: ['bw', 'cn']} };
    

提交回复
热议问题