Can I format queue items dynamically

Hello all,

I want to display some queue items differently based on their status (open, closed, in progress for example).

Can I change the format/ css of an individual queue item based on a value in the record. I am wondering if I can use a render snippet to assign a css class to the item?

Any help much appreciated.

Ben

Answers

  • lukaspovilonis
    edited January 25, 2021

    Hello Ben,

    Not sure if this is what you're looking for, but the JS Snippet bellow implements a simple solution to assigns the style dynamically. You can amend the JS to assign a class.

    Best,

    Lukas

    var params = arguments[0],
        jQElement = params.element,
        item = params.item,
        list = params.list,
        model = params.model,
        template = params.template;
    	$ = skuid.$;
    
    
    let itemColour = 'black';
    switch(item.row.Status){
        case 'open':
            itemColour = 'blueviolet';
             break;
        case 'close':
            itemColour = 'cornflowerblue';
            break; 
             
    }
    
    //change style="..." to class="..."
    jQElement.html(
        '<span style="font-weight:900; color:' + itemColour +'">' + 
            item.row.Name +
        '</span>' + 
            '   -   ' + item.row.Owner.Name); 
    
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!