首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Free-JqGrid :在Panel Bootstrap中不能使用autowidth

Free-JqGrid :在Panel Bootstrap中不能使用autowidth
EN

Stack Overflow用户
提问于 2016-07-20 22:45:44
回答 1查看 408关注 0票数 0

我在Panel Bootstrap中有一个jqGrid,但我找不到为什么autowidth:true参数不起作用。下面是jqGrid代码:

代码语言:javascript
复制
    grid.jqGrid({
        data: myData,
        datatype:'local',
        noDataContent: "Aucune données présente..",
        loadMessage: "Merci de patienter...",
        styleUI : 'Bootstrap',
        colNames: ["Liste des rubriques","Taux Sal","Taux Pat"],
        colModel: [
            {
                name: "Libelle", template: 'string'
            },
            {
                name: "txsalrub", template: 'integer',formatter:'number', formatoptions: {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'}
            },
            {
                name: "txpatrub", template: 'integer',formatter:'number', formatoptions: {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'}
            }
            ],
        // loadonce: true,
        autowidth:true,
        // width: 'auto',
        maxHeight: height
        // width: null,
        shrinkToFit: false,
        // cmTemplate: { autoResizable: true },
        // autoResizing: { compact: true },
        // autoresizeOnLoad: true
    });

这是我得到的结果:

Free JqGrid autowidth not working

我尝试了许多解决方案,但都不起作用:/

EN

回答 1

Stack Overflow用户

发布于 2016-07-21 17:24:33

下面是我的网格中的代码

代码语言:javascript
复制
var grid = $("#decompteUser");
        grid.jqGrid('setGridParam', { data: myData })
            .trigger('reloadGrid', [{ page: 1}]);
        grid.jqGrid({
            data: myData,
            datatype:'local',
            guiStyle: "bootstrap",
            iconSet: "fontAwesome",
            colNames: ["N°décompte","Nbj Payés","Brut Payé","Net Payé","Net Imposable","N° Chèque","Date", "Date Paiement"],
            colModel: [
                {
                    name: "iddec", template: 'string'
                },
                {
                    name: "nbjpayedec", template: 'integer',formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, suffix: " J"}
                },
                {
                    name: "mtbrutdec", template: 'integer',formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, suffix: " €"}
                },
                {
                    name: "mtnetdec", template: 'integer',formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, suffix: " €"}
                },
                {
                    name: "mtnetimposdec", template: 'integer',formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, suffix: " €"}
                },
                {
                    name: "numchequedec", template: 'integer'
                },
                {
                    name: "dteditdec", template: 'string',formatter:'date', formatoptions:{srcformat: 'Y/m/d', newformat: 'd/m/Y'}
                },
                {
                    name: "dtpaiementdec", template: 'string',formatter:'date', formatoptions:{srcformat: 'Y/m/d', newformat: 'Y'}
                }
                ],
            maxHeight: height,
            width:width,
            grouping:true,
            groupingView: {
                groupField : ['dtpaiementdec'],
                groupOrder: 'desc',
                groupColumnShow : true,
                groupText: ['Année : <b>{0}</b>']
            }
        });
        $("#decompteUser").jqGrid('setGridParam',{datatype:'local'}).trigger('reloadGrid');

Result of JqGrid

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38484480

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档