CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

[How To] Override the style of control

Here you can find some answers to your questions, and also some tutorials.

by Alexander Bulei » 08 Apr 2014 12:33

In this tutorial we show you how change or override the css style of control.

Difficulty: Average - require css knowledge


First, you need create the custom (your) css file and load to application.

[Q] How i can load css file to my application?
[A] Use the ContentFiles property.

Below, we show you the living example:

Component: JQDynaTree

  • What is required :
    • Set the background
    • Change the border
    • Change the font-size

To do:

1. Search / Check the css class to override:

- Press F12 to open developer console in browser, and then :

02-06-2016 17-50-00.jpg


2. Override this class, but here we have 2 options:

  • Override only for this control :
    1. You need set the JQDynaTree.Css property to some class (we want mark this control)

      delphi code
      JQDynaTree.Css:= 'my-custom-dynatree';

    2. In css:
      css code
      .my-custom-dynatree ul.dynatree-container {
      background-color: transparent !important;
      border: 1px solid red !important;
      font-size: 12px !important;
      }
  • Override for all controls of that type (in this case all JQDynaTree's controls) :

    css code
    ul.dynatree-container {
    background-color: transparent !important;
    border: 1px solid red !important;
    font-size: 12px !important;
    }


That's all ;)

Best Regards.
You do not have the required permissions to view the files attached to this post.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

Return to Documentation / Tutorials

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.