Pivot Table add configuration to structures list

Hello,

I’m trying to store some configurations that I created in the pivot table, so I’d be able to navigate between them. I understood how to create predefined structures and then sending them as parameter to
{ view:“list”, id:“structures”, data:structures, template:“#label#”, select:true }

However, I can’t seem to store additional structures after init.

Example:

  1. load pivot, predefined structures appear under “My configurations”
  2. Change configuration via [Click to configure] button in the pivot itself, e.g. remove some filters and values.
  3. use
    var structure = $$(“pivot”).getStructure();
    to get the new structure.
  4. try
    $$(“structures”).add(structure,0);
    $$(“structures”).refresh();

I can now see the new structure in the list, but I can’t click on it (the attached event onItemClick fails).

The error is:
var str = webix.copy(this.getItem(id).structure);

Uncaught TypeError: Cannot read property ‘length’ of undefined

Seems like this.getItem(id) returns an empty object

Can you suggest a method to store the current structure in the structures list and have the onClick attachment?

Thanks!

Hello,

Please check the following demo:

http://webix.com/snippet/c65aeffd

Hello Maria,

Thank you very much!, it works perfectly.

Best regards,
Dror