Author Topic: Change ExcelSheet Cell Color  (Read 682 times)

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Change ExcelSheet Cell Color
« on: June 28, 2022, 02:52:02 pm »
Dear Team,
Is there any way to change the excel sheet cell color?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Change ExcelSheet Cell Color
« Reply #1 on: June 28, 2022, 07:38:09 pm »

Code: [Select]
  this.Selection().style('background-color', "#ff0099" );

Example: https://paramquery.com/pro/demos/import-xlsx there is colopicker in the toolbar of this example which uses the same pqgrid API to change color.

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Change ExcelSheet Cell Color
« Reply #2 on: June 29, 2022, 11:18:14 am »
Dear sir,
Is there any event for changing the color by the event? We want to change cell color while copying from the cell, not by the menu.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Change ExcelSheet Cell Color
« Reply #3 on: June 29, 2022, 01:16:31 pm »
it would be the same code inside the copy event

Code: [Select]
copy: function(){
  this.Selection().style('background-color', "#ff0099" );
}

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Change ExcelSheet Cell Color
« Reply #4 on: June 29, 2022, 06:13:46 pm »
 this.Selection().style('background-color', "#ff0099" );

this code takes 5 to 7 seconds to change the cell color. This makes our functionality slow.
« Last Edit: June 29, 2022, 06:25:25 pm by Punit »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Change ExcelSheet Cell Color
« Reply #5 on: June 29, 2022, 08:10:03 pm »
Please share a jsfiddle.

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Change ExcelSheet Cell Color
« Reply #6 on: June 30, 2022, 02:17:17 pm »
Dear sir,
We use the same code as you give the example URL. this is working fine in local but it takes too time when we publish this code in the production environment.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Change ExcelSheet Cell Color
« Reply #7 on: June 30, 2022, 04:49:29 pm »
The code runs in browser and it has nothing to do with local or production environment.

BTW this example https://paramquery.com/pro/demos/import-xlsx is also running in production environment.