gantt.getGridColumns() Can't get Columns


#1

let secondGridColumns = {

            columns: [

              {

                name: “№”, label: “序号”, width: 70, align: “center”, template: gantt.getTaskNumber,

              },

            ]

        };

        gantt.config.layout = {

          css: “gantt_container”,

          cols: [

          {

            width: 70,

            rows: [{

                    view: “grid”,

                    bind: “task”,

                    config: secondGridColumns,

                    scrollable: true,

                    scrollY: ‘scrollVer’,

                },

            ]

           },

            {

              width: document.body.offsetWidth / 7 * 4-70,

              rows: [

                {

                  view: “grid”,

                  bind: “task”,

                  scrollX: “gridScroll”,

                  css: “gantt_container_left”,

                  scrollable: true,

                  scrollY: “scrollVer”

                },

                {

                  view: “scrollbar”,

                  id: “gridScroll”,

                  group: “horizontal”

                }

              ]

            },

            {

              resizer: true,

              width: 1

            },

            {

              rows: [{

                  view: “timeline”,

                  scrollX: “scrollHor”,

                  scrollY: “scrollVer”

                },

                {

                  view: “scrollbar”,

                  id: “scrollHor”,

                  group: “horizontal”

                }

              ]

            },

            {

              view: “scrollbar”,

              id: “scrollVer”

            }

          ]

        };


#2

Hello,
You need to assign the ID to the second grid and it should have the grid name:

        {
    	  id: "grid",
          view: "grid",
          bind: "task",
          scrollX: "gridScroll",
          css: "gantt_container_left",
          scrollable: true,
          scrollY: "scrollVer"
        },

https://docs.dhtmlx.com/gantt/desktop__layout_config.html#requiredviewsandsettings
Here is the snippet where it works:
http://snippet.dhtmlx.com/5/d978d2830