// A simple example of formatting of a tracklist column - in this case bitrate color is modified, very low bitrates in red, etc.

uitools.tracklistFieldDefs.bitrate.override({
    bindData: function ($super, div, item) {
        $super(div, item); // override() gives us $super, so we can call the original code, which renders bitrate and we can only change the color here
        // Note that from performance point of view, it would make more sense to rather do it all here, without calling $super, this is just an example.

        var bitrate = Math.round(item.bitrate / 1000);
        div.style.fontWeight = '';
        if (bitrate > 160) {
            div.style.color = '';
            div.style.fontWeight = 'bold';
        } else
        if (bitrate < 128)
            div.style.color = 'red';
        else {
            div.style.color = '';
        }
    }
});
