Search code examples
angularjswijmo

Wijmo grid dynamic columns with angular


Can someone guide me on how can I generate dynamic columns using Wijmo grid. I need to generate dynamic columns some of which might be editable and might contain textbox, checkbox or dropdown. I am using Angular.

Anyone has any pointers on how to generate these columns dynamically based on the data received from web api using Angular $http call.


Solution

  • I formed the JSON on web api code ..in required format for data and columns and assigned as below. The Metadata will contain array of column meta data objects.

    grid  = $("#wijgrid").wijgrid({
                           editingMode: "row",
                         allowColMoving: true,
                         allowColSizing: true,
                         selectionMode: "none",
                         showFilter: true,
                         allowSorting: true,
                         allowPaging: true,
                         allowEditing: true,
                         beforeCellEdit: onBeforeCellEdit,
                         afterCellEdit: onAfterCellEdit,
                         pageSize: 10,
                         data: $scope.DataRows,
                         columns: $scope.MetaData
                     });