Skip to content

aoGroups should not be an Array #88

Open
@GoogleCodeExporter

Description

@GoogleCodeExporter
Internally, the map from group key to group object is kept in an array, 
aoGroups. That value is not used as an array, however; the length is always 
zero.

This matters when providing a callback method to fnOnGrouped, which takes the 
value of aoGroups as its only argument. You'd think you could pluck a specific 
property from this "array" using, for example, Underscore's pluck method:

  $('#my-rowgrouped-table').dataTable().rowGrouping({
    "fnOnGrouped" : function(aoGroups) {
      console.log("group keys: " + _.pluck(aoGroups, 'key').join());
    }
  });

But this fails, because the array is empty (and Underscore uses duck-typing 
based on the presence or absence of a length property). 

Since the "array"-ness of aoGroups isn't being used and gets in the way of 
reasonable usage, aoGroups should not be an array. (That probably means it 
should be renamed, too.)

Original issue reported on code.google.com by tpeie...@gmail.com on 6 Nov 2014 at 5:17

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions