Search code examples
iccube-reporting

Solve order between widgets


Is there an option to define, in which order to load the data in the different widgets? By default it happens quite often, that some charts have to load multiple times, since after each filter loaded they seem to get triggered.

For example we have 3 filters traffic_group, traffic_partner and traffic_channel that should load in exactly this order, since the result of traffic_group filters the traffic_partners and both filter the traffic_channel.


Solution

  • There is nothing straight forward for this in icCube, but usually this is solved by events dependencies and removing default behaviours for any event in the widgets. Remember that with a default value, events have always a value and related MDX statement is fired on load.

    If you want a fine grained control, you could simulate this dependency by binding both widgets with an event that is only generated by the first filter when the request is recieved. Remember you can add an event as a comment in the MDX statement (it will not affect que query but will act as a trigger).

    In JS hooks for widgets, something like this in 'On Data Recieved' :

    function(context, data, $box) {
        return context.fireEvent(eventName, new viz.event.ValueEvent("you got me") );
    }