I'm working on Extjs 4.2 with a Ext.grid.Panel and I have to set programmatically the color of each row in the grid.
My first option is to use the "getRowClass" in viewConfig by returning a css class name like in the example of Skirtle's Den HERE. But my color is define by the user dynamically and I don't want to create a css file with all possible color.
My second option is to use the rowParams in "the getRowClass" like THIS but for 4.2 the rowParams is deprecated.
I can also override the rowTpl in viewConfig or set the color of each cell of a row thanks to meta.style in the renderer function from Ext.grid.colum.Column but maybe do you know an easier way to do that?
Try this:
Ext.fly(grid.getView().getNode(2)).setStyle({background:'yellow'});
I would set 3rd row of the grid to yellow, however, you still need to switch off the backgrounds of individual cells.
Related
I am using CRUD operation on Primeng Datatable. If i clicked row of the table it raises the dialog box to edit the data. But selected row's background changed to blue. Is there any way to change background color of selected row? Primeng version 9.1.1
i referred previous stackoverflow question But not working.
Use
:host p-table ::ng-deep .ui-state-highlight{ background:red; }
Explain
After :host you have to set the component that host in your component (in your case the Primeng table)
And then after ::ng-deep set the class that inside the hosted component that you want to change
for example stackblitz
EDIT
to make it more generic you can put the code in style.css file as below
p-table .ui-state-highlight{ background:red!important; }
see example here
I want to show a multiline text so I use a span label. I am trying to set the font size from the gui but it does not change.
I also trying to set the color dynamicaly using the next code:
this.gui_Span_Info.getAllStyles().setFgColor(HTMLElement.COLOR_RED);
but nothing happens.
What should I do?
SpanLabel is a composite component which means it's built from 2 or more separate components one of which is a Container.
You can determine the UIID of the text using setTextUIID it defaults to the Label UIID.
I just started building my first App with Codename One and I'm having quite some trouble. :-)
I cant change the background color of a TextField, I changed everything in the Theme and named it "TextField". At the Color tab I changed the background color and set Transparency to 255. Since the Component is named TextField, shouldnt the style be applied automatically when I make a new TextField?
I also tried to set the UIID manually to "TextField", which didn't help either.
Am I missing something?
Kind regards,
Max
The way backgrounds work in Codename One is this:
Border is applied first
Then image
Then gradient
Then color
TextField and other components such as Button etc. often have a default border derived from the theme.
Switch to the Border tab, click derive then click the ... button and select empty.
I am currently working in the C# windows application with DevExpress controls.
Now I want to change back color of bar button item while loading the form.
I've tried following code:
barButton.Appearance.BackColor = Color.Red;
but the bar button back color not changed to red.
By default, bars use the skins to draw their content. In this case, all background colors are provided by specific skin elements, which cannot be changed. The only way to change a specific item's background color is to disable skins:
put the BarAndDockingController component onto a form, and assign it to the BarManager.Controller property. Set BarAndDockingController.PaintStyleName or LookAndFeel to any non-skin style(for example "Flat"). Then use the Bar.Appearance.BackColor property to set the desired color.
Alternatively, you can create your own custom barItem in a way similar to the one described in the How to change the background color of highlighted links KB article.
This question is specific to Adobe CQ5, so ExtJS answers by themselves won't be that helpful.
I have a custom text component with a menu option to change the background color. We're referencing a colorfield component in our dialog.xml, and so far everything works. The color menu appears with the default set of colors in the palette and can be clicked. So far so good.
I would now like to customize the palette and only show a select set of colors specific to our client. How do I achieve this?
Here's the relevant dialog.xml snippet so far:
<bgcolor
jcr:primaryType="cq:Widget"
fieldLabel="Background color"
name="./bgColor"
showHexValue="true"
xtype="colorfield"/>
For future reference, you could probably get by creating a custom ColorField to call a custom ColorMenu which sets a custom ColorPalette. If ColorField had configurable options, these would probably be mentioned in the Ext docs or found in the JS file itself in /libs/cq/ui/widgets/..
Found it on dev.day.com - http://dev.day.com/content/kb/home/cq5/Development/HowToCreateCustomClientLib.html
Simply put, override the ExtJS widget with your own. Not ideal but it'll do.