How To Change A Row's Background-color Or Color Comparing Pieces ...

  • Contact Us
  • Blog
  • Sign In
Search Find anything about our product, documentation, and more. Blazor Components | 70+ Native UI Controls | Syncfusion® https://www.syncfusion.com/blazor-components The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps. .NET PDF Framework | C# / VB.NET PDF API | Syncfusion® https://www.syncfusion.com/pdf-framework/net .NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET. 155+ Xamarin UI controls for iOS, Android & UWP apps | Syncfusion® https://www.syncfusion.com/xamarin-ui-controls Over 155 Xamarin UI controls to create cross-platform native mobile apps for iOS, Android, UWP and macOS platforms from a single C# code base. My Dashboard SIGN OUT
  1. Home
  2. Forum
  3. jQuery
  4. How to change a row's background-color or color comparing pieces of information
How to change a row's background-color or color comparing pieces of information
  • 1 Reply
  • 2 Participants
  • Created by DP Daniel Pujante
  • PlatformjQuery
  • PlatformjQuery
  • ControlejGrid
  • Created OnApr 21, 2017 07:54 AM UTC
  • Last Activity OnApr 24, 2017 06:45 AM UTC
  • Want to subscribe? SIGN IN
Hi,I've been whaching the example you show on:http://jsplayground.syncfusion.com/Sync_sn3ev02oThis example is just I need, but selecting the whole line instead.I've being seeing concretely this: queryCellInfo: function (args) { if (args.column !== undefined && args.column.field === "unitPrice") { var $element = $(args.cell); if (Globalize.parseFloat(Globalize.format(args.text, "c")) < 30) { $element.css("background-color", "#b0e98f").css("color", "black"); } else { $element.css("background-color", "#f4a496").css("color", "black"); } } }I'd would like the same but selecting the whole line instead a cell, could you give me a example, I would be very grateful.Thank you very machRegards,Daniel Pujante SIGN IN To post a reply. 1 Reply PK Prasanna Kumar Viswanathan Syncfusion Team April 24, 2017 06:45 AM UTC Hi Daniel, Thanks for contacting Syncfusion support. To change the row background color, use rowDataBound event of ejGrid. This event will be triggered every time a request is made to access row information, element and data. In this event we can get the row element in the arguments and change the background color according to the value of unitPrice. Find the code example and sample:
$("#Grid").ejGrid({ dataSource: window.details, enableRowHover: false, allowSelection: false, columns: [ ----------------------------- ], rowDataBound: function (args) { var $element = $(args.row); if (args.data.unitPrice < 30) { $element.css("background-color", "#b0e98f").css("color", "black"); } else { $element.css("background-color", "#f4a496").css("color", "black"); } }
Sample: http://jsplayground.syncfusion.com/2yrt3k3h Refer to the Help document for the rowDataBound event. https://help.syncfusion.com/api/js/ejgrid#events:rowdatabound Regards, Prasanna Kumar N.S.V SIGN IN To post a reply.
  • 1 Reply
  • 2 Participants
  • Want to subscribe? SIGN IN
  • Created by DP Daniel Pujante
  • PlatformjQuery
  • ControlejGrid
  • Created OnApr 21, 2017 07:54 AM UTC
  • Last Activity OnApr 24, 2017 06:45 AM UTC
Loader. 12/08/2025 09:04:30 AM Sun, 15 December 2024 03:30:00 UTC Sun, 15 December 2024 03:30:00 AM Wed, 16 Feb 2022 04:59:00 UTC Up arrow icon

Tag » Add Background Color To Tr Jquery