How to set KendoGrid column fields array with the results of a JS function

#1

I have a JS function “columnFields()” that returns a string array of what I want the column names in a KendoGrid to be. How do I set the column fields to that array?

I am currently trying to do it by creating a custom KendoGrid:

C3.define("C3.view.My.CustomKendoGrid",
    {
		extend: "C3.view.KendoGrid",
            columns: [{
            fields: [the results of columnFields()]
        }]
0 Likes

#2

Is columnFields an API call? If that’s the case, I think you’ll need a DynamicGrid instead of a KendoGrid.

From the DynamicGrid docs:

This component allows users to create a KendoGrid with dynamic column configurations as defined by a data source.

0 Likes