Thanks. Since you are using nested objects you will need to use pluck() twice, once for each level. Try this:
pluck()
var subLevelCount = rows.data().pluck( 'buono' ).pluck( 'n_bxd' ).unique().count();
Kevin
@kthorngren i dont see your answer sorry but workssss thaaanks maaan!!
Did you try my suggestion? I don't see that you changed the test case.
Thanks Kevin! I had never used "pluck" before. Just tried it.
I replaced this:
... var rows = dt.rows({ search: 'applied' }).data().toArray(); var ctrGovdeptIdArray = rows.map(function(a){return a.ctr_govdept.id;});
with this:
... var ctrGovdeptIdArray = dt.rows({ search: 'applied' }).data() .pluck('ctr_govdept').pluck('id').toArray();
Works!
Answers
Thanks. Since you are using nested objects you will need to use
pluck()twice, once for each level. Try this:Kevin
@kthorngren i dont see your answer sorry but workssss thaaanks maaan!!
Did you try my suggestion? I don't see that you changed the test case.
Kevin
Thanks Kevin! I had never used "pluck" before. Just tried it.
I replaced this:
with this:
Works!