Author Topic: setting color of nested grid  (Read 1711 times)

ketkigaur

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 4
    • View Profile
setting color of nested grid
« on: March 16, 2021, 10:09:16 pm »
HI,

Can you please share some demo on how to set colors of a nested grid dynamically. I am using rowinit method to set color of main grid but it doesnt work for a nested grid.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: setting color of nested grid
« Reply #1 on: March 16, 2021, 10:20:38 pm »
rowInit of main grid works for rows in main grid only.

To change style of rows in detail grid, please implement rowInit of detail grid.

ketkigaur

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: setting color of nested grid
« Reply #2 on: March 16, 2021, 10:56:57 pm »
Hi,
As mentioned earlier, I have tried rowInit for detail grid but that didnt work.
 Is there anything different in way the style needs to be set in rowInit method for detail grid. Can you share an example?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: setting color of nested grid
« Reply #3 on: March 16, 2021, 11:16:10 pm »
Please check this example for setting text-color of the rows to red in detail grid.

https://jsfiddle.net/jb0gv389/

Code: [Select]
rowInit: function(ui){
  return {
    style: "color:red;"
  }
},

ketkigaur

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: setting color of nested grid
« Reply #4 on: March 17, 2021, 03:06:25 am »
Thank you. I was able to implement styling dynamically using this.