Author Topic: Help with Conditional Formatting  (Read 1854 times)

rohanshiv

  • Newbie
  • *
  • Posts: 2
    • View Profile
Help with Conditional Formatting
« on: September 12, 2020, 08:55:40 am »
In the demo https://paramquery.com/demos/render_cells, rowData[4] accesses the change and rowData.pq_cellcls[dataIndx] is used to set the class to the cell. For JSON data, I am able to access my data using rowData["Fees"] and rowData.Fees but am slightly confused on how to change the class of the cell using the rowData array. I have tried rowData.Fees.pq_cellcls ="pink"; and rowData.pq_cellcls.Fees = "pink"; which do not work . I have created css code using the example for pink. This is a very powerful grid and I am considering the pro version if I can get this to work.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Help with Conditional Formatting
« Reply #1 on: September 15, 2020, 08:14:25 pm »
rowData.pq_cellcls.Fees = "pink"; is correct one.

You also need to assign css rules to the class

Code: [Select]
.pq-grid td.pink
{
    background:pink;
}

rohanshiv

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Help with Conditional Formatting
« Reply #2 on: September 16, 2020, 12:15:51 am »
Hi,

I get "undefined is not an object (evaluating 'rowData.pq_cellcls.Fees = "pink"')" when I put the class assignment in a try catch block. I am using JSON data by remotely getting it from a MySQL server if that matters. I believe rowData.pq_cellcls is undefined leading to this error. Does this need to be assigned somewhere previously that I am missing?