24
Views
7
Comments
How to highlight selected values
Question

Hello,

I have few containers containing values from entity. On selecting(click) the value the container need to be highlighted to show it as selected item.  Again onclick it need to be deselected. I can select multiple items. How to highlight or change css when selected. I can attach a sample oml if needed.



Thanks.

Rank: #89

Hi Priya,

you can do it by simple JS code-

On Page

put this code on JS property-

$(document).on('click','.CommonClass', function(){
    if($(this).attr('class').split(' ').pop()=='selected')
    {
     $(this).removeClass('selected');
    }
    else
    {
    $(this).addClass('selected');
    }
});

Put this css on Css property 

.selected{
    background-color: #861b1b;
    color: #fff;
}
.CommonClass{
border: 1px solid black;
cursor: pointer;

}


Provide a name CommonClass for container.

See Demo- https://rahul-sahu.outsystemscloud.com/Email/Demo.aspx?_ts=637301428896480625 

let me know if you want any other solution.

Hope this will help you.

Regards

Rahul Sahu

Rank: #89

Hi Priya ,

Now you can check , i have made it anonymous.

Can you provide oml.


Regards

Rahul Sahu

Rank: #89

Hi Priya,

I have updated you oml find it but i didnt understand what you want achive.

why Every onclick you call db action for create or update?


Regards

Rahul Sahu

Demo.oml