Targetprocess

The Targetprocess Developer Hub

Welcome to the Targetprocess developer hub. Here you'll find comprehensive guides and documentation to help you start working with Targetprocess as quickly as possible and support you if you get stuck. Let's jump right in!

Docs
Ask A Question

Questions

Mashup: Hide columns on detail views

Posted by Llewellyn 4 months ago

I am attempting to hide the effort and progress columns on the detail views of features and releases (user story and bug tabs). The following code removes the columns however this code is executed at the load mashups screen which is well before the detailed views finish rendering on screen. Therefore, this code has no effect on those columns.

tau.mashups
.addDependency('Underscore')
.addDependency('jQuery')
.addDependency('tau/core/bus.reg')
.addDependency('tau/configurator')
.addMashup(function(_, $, reg, configurator) {

    'use strict';

    var addBusListener = function(busName, eventName, listener) {

        reg.on('create', function(e, data) {

            var bus = data.bus;
            if (bus.name === busName) {
                bus.on(eventName, listener);
            }
        });

        reg.on('destroy', function(e, data) {

            var bus = data.bus;
            if (bus.name === busName) {
                bus.removeListener(eventName, listener);
            }
        });
    };

    var hideColumns = function() {

        addBusListener('board.editor.container', 'afterRender', function(e, data) {
            data.element.find(".tau-list-effort_total-unit").remove();
            data.element.find(".tau-list-effort_total-cell").remove();
            data.element.find(".tau-list-progress_long-unit").remove();
            data.element.find(".tau-list-progress_long-cell").remove();
            alert("Hide Columns Activated");
        });
    };

    hideColumns();
});

Questions:
1) Is there a better listener to use that will trigger my code after the detail views load? Or is there a better approach to achieving this?
2) Is there a full list of available listeners that your team has documented?

Loading comments...