not sure if this is what you're looking for... and I'm just typing out loud... Have two object variables, one that stores lookup info, and one that stores your groups. var Grouping = {}; Grouping.Lookup = {}; Grouping.Groups = {}; When you add a group, create a unique name, we'll use '123'. Add each item to group '123', or by push. Grouping.Groups["123'] = [id1, id2, id3]; Add each item in the lookup table for quick reference, instead of resorting to searching a bunch of arrays. Grouping.Lookup["id1"] = "123"; Grouping.Lookup["id2"] = "123"; Grouping.Lookup["id3"] = "123'; Could use an on("change:graphic") event to capture the object changing, find the group it belongs to from the lookup, and loop through all items in group. Granted, i know you're talking about paths, but looping objects is looping objects... :) on("change:graphic", function(obj) { for (i = 0, i < Grouping.Groups[Grouping.Lookup[obj.get("_id")]], i++) {
//do your code for each item
} });