columns

Gets or sets the columns configuration.

Parameters

val Array

The columns configuration. Accepts the same values as the columns option.

Returns

Array—The current columns configuration.

Example - set the columns

<script>
var dataSource = new kendo.data.PivotDataSourceV2({
  type: "xmla",
  transport: {
    connection: {
        catalog: "Adventure Works DW 2008R2",
        cube: "Adventure Works"
    },
    read: "https://demos.telerik.com/olap/msmdpump.dll"
  }
});

dataSource.columns(["[Date].[Calendar]"]);
</script>

Example - get the columns name

<script>
var dataSource = new kendo.data.PivotDataSourceV2({
  type: "xmla",
  columns: ["[Date].[Calendar]"],
  transport: {
    connection: {
        catalog: "Adventure Works DW 2008R2"
    },
    read: "https://demos.telerik.com/olap/msmdpump.dll"
  }
});

var columns = dataSource.columns();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(columns);// [{ name: ["[Date].[Calendar]"] }]
</script>
In this article