rallyappsdk2

Dynamically set ID of the Card DIV Component in Rally CardBoard


What I’m trying to accomplish: dynamically set id to the card's div in cardConfig when onload

For example: Overwrite the id of following component

<div class="x-component iterationtrackingboard-card rui-card portfolioitem card-134459361996 editable x-component-default x-border-box drag-handle" id="rallycard-1157">

Failed attempt:

cardConfig: {
    editable: true,
    showIconMenus: true,
    listeners: {
        load: function() {
            // Set ID…
        }
    }
},

Solution

  • How about the afterrender event instead?

    {
        listeners: {
            afterrender: function(card) {
                var record = card.getRecord(),
                    el = card.getEl();
                    //set id here
            }
        }
    }