Javascript - How to add objects to column array in kendo ui grid dynamically?
I am trying to generate objects in the columns array as the heading implies, although I haven't found a working method. alert( "Value 1: " + temporaryArray[1] + " - " + finalArray[1].values ); alert( "Value 2: " + temporaryArray[2] + " - " + finalArray[2].values ); var myGrid = $("#grid").kendoGrid( { columns: [ { title: temporaryArray[0] + " ", field: gridArray[0].values + " " } ], dataSource: { data:finalArray, pageSize:10 }, scrollable:false, pageable:true }); I've tried the following to add the object: for( var x = 0; x < finalArray.length; x++ ) { myGrid[columns] = { temporaryArray[x]