javascript - dynamically add column and its data in UI grid -
i have requirement need add dynamic columns , it's data in angular ui-grid.
i able add columns pushing new columns in columndef. not able add data new column.
my fixed col def:
$scope.workflows.columndefs = [ { name: 'workflowid', pinnedleft:true,width:100,enablefiltering: false }, { name: 'workflowname',enablefiltering: true}, { name: 'type',enablefiltering: false}, { name: 'status', filter: { type: uigridconstants.filter.select, selectoptions: [ { value: 'completed', label: 'completed' }, { value: 'fail', label: 'fail' }, { value: 'pending', label: 'pending'}, { value: 'in_progress', label: 'in_progress'} ] }}, { name: 'submitteddate',enablefiltering: false}, { name: 'submittedby',enablefiltering: false}, { name: 'failurereason',enablefiltering: false} ];
dynamic col dev:
$scope.workflows.columndefs.push ({ new col def});
fixe columns data :
[{workflowid: 34570, workflowname: "name", type: "type", status: "completed"}]
dynamic data:
[{newcol:'data'},{newcol:'data'}]
Comments
Post a Comment