Our blazing fast Grid component built with pure JavaScript


Post by umeshaithu »

Hi support,

How can I add bg-color to a toolbar in grid?

Thanks.


Post by tasnim »

Hi,

You could use this CSS to achieve it

.b-toolbar {
    background-color: #a6ffe5;
}
Attachments
Screenshot 2024-03-19 151700.png
Screenshot 2024-03-19 151700.png (50.34 KiB) Viewed 297 times

Post by umeshaithu »

I want to use it as a custom class.. toolbar have been used in various places and I don't want to disturb them


Post by tasnim »

Hi,

You can add a custom cls to the toolbar with this https://bryntum.com/products/grid/docs/api/Core/widget/Toolbar#config-cls

new Grid({
	...
	tbar : {
		cls : 'customCls',
		items : [...]
	}
});

And then you can style it with the custom cls

.b-toolbar.customCls {}

Post by umeshaithu »

Thanks..


Post by umeshaithu »

I'm unable to add the class as tbar in my thing is an array of items like below.


const gridconfig={
tbar:[]
}
return <BryntumGrid ref={grid} {...gridConfig} />

How should I add a class in this case?


Post by mats »

You need to provide an object as Tasnim showed:

tbar : {
		cls : 'customCls',
		items : [...]
	}

Post Reply