Clicking on a row in ng2-smart-table should result in the row being

I have attempted to address the issue, but I am struggling to highlight a row on click event.

<ng2-smart-table [settings]="settingsPatient" [source]="sourcePatient" (userRowSelect)="patientStudy($event)" (deleteConfirm)="onDeleteConfirm($event)">""

</ng2-smart-table>

I am working with Angular 7 and when I attempt to click on a row in ng2-smart-table, the row does not get highlighted. For example, the color of the row does not change when I click on it.

This is the function I am using for the row click event - (userRowSelect)="patientStudy($event)".

Answer №1

If a row is chosen, the 'selected' category will be added to it... this is where we can change the appearance of the row by utilizing:

::ng-deep tbody  tr.ng2-smart-row.selected
{ background:lightblue !important; border:1px solid blue;}

view the functional stackblitz here

Answer №2

I have found success with the following solution:

::ng-deep .nb-theme-default ng2-smart-table tbody tr.selected, .nb-theme-default ng2-smart-table tbody tr:hover { background: rgb(34, 151, 190) !important; border:1px solid blue; }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble running a form due to the inclusion of JavaScript within PHP code

My PHP code includes a form that connects to a database, but when I add JavaScript to the same file, the form does not execute properly. (I have omitted the insert code here.) echo '<form action="$_SERVER["REQUEST_URI"];" method="POST">'; ...

Can you explain the purpose of the behavior: url(); property in CSS?

While browsing the web, I came across a CSS property that caught my eye. It's called behavior, and it looks like this: #element{ behavior: url(something.htc); } I've never used or seen this property before. It seems to be related to Internet ...

What is the best way to ensure that empty strings are not included in the length of my array?

I have encountered an issue with a JSON file that I fetch. The array syllables is capable of holding up to strings max. However, when I exclude 2 words, I end up with 2 words and 2 empty strings. Nevertheless, my front-end still expects 4 "strings". So, it ...

Troubleshooting: Issue encountered while adding jQuery Slideshow plugin to current website

I am currently facing some challenges with a specific feature on my website. I am trying to integrate Jon Raasch's "Simple jQuery Slideshow Plugin" into an existing site that was not originally built by me. However, when viewing the site in IE 9, two ...

Position the flex item adjacent to the initial flex item using wrap mode only if there is extra space

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <titl ...

Guide to generating an iframe that is triggered by a button click with the help of jquery

Is it possible to dynamically insert an iframe into a column div on a web page by clicking on it? I want the iframe to remain hidden when just viewing the page, but to become visible when a button is clicked. How can this be achieved? ...

Despite being present in the node_modules folder, the ag-grid-vue module appears to be missing

Currently, I am diligently following the Vue.js AgGrid getting started tutorial step by step: https://www.ag-grid.com/vuejs-grid/ However, upon adding the <script> section and saving my progress, an error promptly appears: ERROR Failed to compile ...

Displaying MySQL data on an HTML page with Node.js

Hello there, I recently started delving into Node.js for the first time. My current project involves fetching data from MySQL and displaying it on my HTML page. However, when I try to access my website at http://localhost:3000/index.html, I encounter an er ...

Tips for utilizing ui-sref in a complex Angular UI router configuration

After spending hours researching and implementing different techniques, I am still unable to solve the issue. My application consists of three main navigations: home, sports, and country. <head> <script src="js/angular-ui-router.min.js"></s ...

I am unable to view the map on my webpage. This issue only arises when I apply a CSS style to it

Hey there! I'm having trouble displaying a map on my website. For some reason, the map is not showing up even after updating the Google secret key in my code: <?php session_start(); include '../../WSweb/serv.php'; if(isset($_SESSION[&a ...

Step-by-step guide to creating a flip effect with Angular 2 animations

I've been utilizing pure css flip of cards in my project, but I feel like it's not the best solution. Does anyone know how to create a card flip in angular 2 upon clicking a button? I came across one in angularjs here <div ng-app="cardFli ...

Retrieve the key associated with the value array that contains the text being searched for in an AJAX

I have a project where I am handling data to develop a search tool that allows users to search for the name of an individual involved in a legal case. The tool will then display a table with the individual's name, role, and other case details in a spe ...

Issue: The function (0, react__WEBPACK_IMPORTED_MODULE_1__.useActionState) is not recognized as a valid function or its output is not iterable

I found a great example of using useActionState at this source. Currently, I am implementing it in my project with Next.js and TypeScript. app/page.tsx: "use client"; import { useActionState } from "react"; import { createUser } from ...

Uploading CSV file in Angular to populate the scope rather than sending it to the server

I need assistance with allowing users to upload a CSV file, which will then be displayed and validated. Rather than uploading the file directly to the server, I would prefer to keep it within scope until validation is complete. Unfortunately, Angular 1.5. ...

Clearing a leaflet layer after a click event: Step-by-step guide

When working with my map, I attempt to toggle the layer's selection using a mouse click. Initially, my map looks like this: https://i.sstatic.net/lOI95.png Upon clicking a layer, my goal is to highlight and select it: https://i.sstatic.net/63Rx2.pn ...

Tips for aligning input vertically across rows with bootstrap 5

I'm currently working on a form layout where each row contains a different number of columns, with labels and inputs in each column. However, I'm facing an issue where the start of the input is not aligned vertically for each row. I tried using ...

Is there a way to customize the hover color of the Bootstrap 4 navbar toggler?

I'm working with Bootstrap 4 and I would like the color of my navbar toggle icon (commonly referred to as the burger menu) to change when it is hovered over. I have attempted the following code but it is not producing the desired result: .navbar-light ...

Angular 2: Navigating through submenu items

I have a question about how to route submenu elements in Angular 2. The structure of my project is as follows: -app ---login ---registration ---mainApp (this is the main part of the app, with a static menu and links) -----subMenu1 (link to some con ...

Using an AngularJS directive to trigger a function with ng-click

Everything is working well with my directive, but I would like to utilize it within ng-click. Unfortunately, the function inside the link is not getting triggered. Here's the link to the code snippet. <div ng-app="editer" ng-controller="myCtrl" ...

How can I implement a promise loop in Angular that continues until it encounters a rejection?

My goal is to efficiently load around 10000 resources, but loading them all at once during the resolve phase is taking too long due to some calculations. I then had the idea to load the resources page by page sequentially, however, since all resources need ...