angularjs - Merging ui-grid data -


having 2 ui-grid,

vm.grid.order , having val1 & val2 vm.grid.reorder , having val3 & val5 & val7 

bind these 2 grid values vm.order

vm.order = vm.grid.order; vm.order.push(vm.grid.reorder) 

it returns array this

  {     [0]: "val1",     [1]: "val2",     [2]: ["val3", "val5", "val7"],     etc   } 

how can this

 {     [0]: "val1",     [1]: "val2",     [2]: "val3",      [3]: "val5",      [4]: "val7"     etc   } 

use concat method:

vm.order = vm.grid.order.concat(vm.grid.reorder) 

see https://developer.mozilla.org/en/docs/web/javascript/reference/global_objects/array/concat


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -