Author Topic: When colModel.collapsible is enabled, hidden of child.colModel does not work  (Read 2399 times)

ohbayashi

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 41
    • View Profile
Ver. 5.1.0

If there is no collapsible -> not displayed
Code: [Select]
        {
            title: "Group A", align: "center", colModel: [
                { title: "ID", dataIndx: "railway_company_id", hidden: true, editable: false, dataType: "integer", minWidth: 60, align: "center" },
                { title: "name *", dataIndx: "railway_company_name", dataType: "string", minWidth: 160 },
                { title: "order *", dataIndx: "railway_company_display_order", dataType: "integer", align: "center", minWidth: 60, maxWidth: 60 },
                { title: "visible *", dataIndx: "railway_company_visible_flag", dataType: "bool", minWidth: 64, align: "center", editor: false },
            ],
        },


If there is collapsible -> it will be displayed
Code: [Select]
        {
            title: "Group A", align: "center", collapsible: { on: false }, colModel: [
                { title: "ID", dataIndx: "railway_company_id", hidden: true, editable: false, dataType: "integer", minWidth: 60, align: "center" },
                { title: "name *", dataIndx: "railway_company_name", dataType: "string", minWidth: 160 },
                { title: "order *", dataIndx: "railway_company_display_order", dataType: "integer", align: "center", minWidth: 60, maxWidth: 60 },
                { title: "visible *", dataIndx: "railway_company_visible_flag", dataType: "bool", minWidth: 64, align: "center", editor: false },
            ],
        },

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Hidden columns are not to be kept inside collapsible group columns.

Please keep them outside.

Code: [Select]
        { title: "ID", dataIndx: "railway_company_id", hidden: true, editable: false, dataType: "integer", minWidth: 60, align: "center" },
        {
            title: "Group A", align: "center", collapsible: { on: false }, colModel: [
                { title: "name *", dataIndx: "railway_company_name", dataType: "string", minWidth: 160 },
                { title: "order *", dataIndx: "railway_company_display_order", dataType: "integer", align: "center", minWidth: 60, maxWidth: 60 },
                { title: "visible *", dataIndx: "railway_company_visible_flag", dataType: "bool", minWidth: 64, align: "center", editor: false },
            ],
        },
« Last Edit: May 07, 2018, 06:25:29 pm by paramquery »

ohbayashi

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 41
    • View Profile
I want to display / hide the ID with the checkbox on the toolbar, but is there any other good method?

Code: [Select]
    protected tbBtnViewId = {
        type: "checkbox", label: "View ID", value: false,
        listener: { "change": (evt) => {
            let cols = this.grid.Columns();
            cols.each((column) => {
                if ("title" in column && column.title === "ID") {
                    column.hidden = !evt.target.checked;
                }
            });
            this.grid.refresh();
        }},
    };

ohbayashi

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 41
    • View Profile
Since we changed the specification, this correspondence becomes unnecessary.

So please ignore this reply.

Thank you.