mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.81k stars 1.98k forks source link

Blank rows grouping #1197

Closed SilentXHeroes closed 5 years ago

SilentXHeroes commented 5 years ago

Hello everyone, I have an issue with my slickgrid. I'm using "grouping" on a list with different categories and this happens :

image

Blank rows appear in the slick instead of group rows. Two days ago my code worked perfectly and now I have this issue ...

My columns:

var originalColumns = [
        {
            id: "cip",
            name: "CIP/EAN",
            field: "cip",
            formatter: formatCIP13,
            width: 200,
            visibility: 1,
            sortable : true
        },
        {
            id: "nom",
            name: "Produit",
            field: "nom",
            width: 200,
            visibility: 1,
            sortable : true
        },
        {
            id: "info_prod",
            name: "Infos Compl",
            field: "info_prod",
            width: 200,
            visibility: 1,
            sortable : true
        },
        {
            id: "stock",
            name: "Stock",
            field: "stock",
            width: 200,
            visibility: 1,
            type: "fromTo",
            isSum: true,
            sortable : true
        },
        {
            id: "qteprop_ligcom",
            name: "Prop.",
            field: "qteprop_ligcom",
            width: 200,
            visibility: 1,
            type: "fromTo",
            isSum: true,
            sortable : true
        },
        {
            id: "qtecom_ligcom",
            name: "Cmd\u00E9",
            field: "qtecom_ligcom",
            width: 200,
            visibility: 1,
            type: "fromTo",
            isSum: true,
            sortable : true
        },
        {
            id: "prixcat_ligcom",
            name: "Prix Cat.",
            field: "prixcat_ligcom",
            width: 200,
            visibility: 1,
            type: "fromTo",
            sortable : true,
            nbDecimal: 2
        },
        {
            id: "txremg_ligcom",
            name: "Remise",
            field: "txremg_ligcom",
            type: "fromTo",
            width: 200,
            visibility: 1,
            sortable : true
        },
        {
            id: "prixremht_ligcom",
            name: "Prix HT",
            field: "prixremht_ligcom",
            width: 200,
            visibility: 1,
            type: "fromTo",
            sortable : true,
            nbDecimal: 2
        },
        {
            id: "coeff",
            name: "Coefficient",
            field: "coeff",
            width: 200,
            visibility: 1,
            type: "fromTo"
        },
        {
            id: "marge",
            name: "Marge",
            field: "marge",
            width: 200,
            visibility: 1,
            type: "fromTo",
            sortable : true
        },
        {
            id: "marge_per",
            name: "Marge (en %)",
            field: "marge_per",
            width: 200,
            visibility: 1,
            type: "fromTo",
            sortable : true
        },
        {
            id: "prix_public_ht",
            name: "Px Public HT",
            field: "prix_public_ht",
            width: 200,
            visibility: 1,
            type: "fromTo",
            sortable : true
        },
        {
            id: "pxpub_ligcom",
            name: "Px Public TTC",
            field: "pxpub_ligcom",
            width: 200,
            visibility: 1,
            type: "fromTo",
            sortable : true,
            nbDecimal: 2
        },
        {
            id: "etat",
            name: "\u00C9tat",
            field: "etat",
            width: 200,
            visibility: 1,
            type: "select",
            sortable : true
        },
        {
            id: "montant_ht",
            name: "Montant HT",
            field: "montant_ht",
            width: 200,
            visibility: 1,
            type: "fromTo",
            isSum: true,
            sortable : true
        },
        {
            id: "tva",
            name: "TVA",
            field: "tva",
            width: 200,
            type: "select",
            visibility: 1,
            sortable : true
        },
        {
            id: "ventes_ann",
            name: "Ventes Ann.",
            field: "ventes_ann",
            width: 200,
            visibility: 1,
            type: "fromTo",
            sortable : true
        },
        {
            id: "nom_fournisseur",
            name: "Fabricant",
            field: "nom_fournisseur",
            width: 200,
            visibility: 1,
            type: "select",
            sortable : true
        },
        {
            id: "qteug_ligcom",
            name: "UG",
            field: "qteug_ligcom",
            width: 200,
            visibility: 1,
            type: "fromTo",
            isSum: true,
            sortable : true
        },
        {
            id: "pareto",
            name: "Pareto",
            field: "pareto",
            width: 200,
            visibility: 1,
            type: "select",
            sortable : true
        },
        {
            id: "code_uv",
            name: "code_uv",
            field: "code_uv",
            width: 1,
            maxWidth: 0,
            visibility: 0,
            cssClass: "hidden",
            headerCssClass: "hidden",
            notParam: true
        },
        {
            id: "retour_ligcom",
            name: "Catégorie",
            field: "retour_ligcom",
            type: 'select',
            editor: Slick.Editors.Text,
            cssClass: "editCell",
            width: 200,
            visibility: 1,
            sortable : true
        },
        {
            id: "fakeId",
            name: "fakeId",
            field: "fakeId",
            width: 1,
            maxWidth: 0,
            visibility: 0,
            cssClass: "hidden",
            headerCssClass: "hidden",
            notParam: true
        }
];

There is my code to set the grouping:

dataView.setGrouping({
        getter: "retour_ligcom",
        formatter: function (g) {
                return g.value;
        },
        aggregators: [],
        aggregateCollapsed: true,
        lazyTotalsCalculation: true
});

Options set to the slickgrid:

var options = {
        syncColumnCellResize: true,
        editable: true,
        enableCellNavigation: true,
        asyncEditorLoading: false,
        autoEdit: false
};

Grouping rows are not even defined as slick-group class ...

image

Please someone help me I've tried everything to make this work.

Using last version of original Slickgrid

6pac commented 5 years ago

Assume you worked it out? Just FYI active development has now moved to https://github.com/6pac/SlickGrid