This is a migrated thread and some comments may be shown as answers.

Question/bug to apply CSS class to an element

5 Answers 15 Views
Editor
This is a migrated thread and some comments may be shown as answers.
miksh
Top achievements
Rank 1
Iron
miksh asked on 10 Sep 2015, 02:51 PM

Go to online demo http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

1. When a css class applied to an element, e.g. a link, from the classname dropdown then when this element selected after that, the css class is not displayed in this dropdown. See http://screencast.com/t/xUKA00DUusUr
Is it bug or feature?

2. Is there a way to allow entering any class name which is not listed in this classname dropdown, e.g. "greenText"?

 

 

 

 

 

 

 

5 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 11 Sep 2015, 06:05 AM
Hi Michael,

The reported issue is related to this bug—http://feedback.telerik.com/Project/108/Feedback/Details/139016. Due to the issue with selection, the Apply Css Class tool cannot property update its state.

As for adding additional classes, take a look at this help article—http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/functionality/toolbars/dropdowns/css-styles.

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
miksh
Top achievements
Rank 1
Iron
answered on 11 Sep 2015, 12:52 PM

Yes, looks like the issue is limited to IE11.

Re. assigning css class: there is no issue to configure css class dropdown with any predefined classes and let a user select it. Since this element is implemented as dropdown list then there is no way to a user to enter a css class which is not a part of that list. E.g. in the editor overview demo how a user could set the css class "my-green-link" to the first link in the text? The only way I know is to go to html mode and add it manually which could be tricky for many users.

As a workaround, I'd like to have a combobox with custom values allowed. 

0
Ianko
Telerik team
answered on 12 Sep 2015, 07:24 AM
Hi,

There is no built-in tool that can do that. The reason for a custom value to not be available is because if a value does not exist, then the element will not be decorated, as there is no CSS behind that class. Therefore, it is a must for the user to go to HTML, add the class and add the CSS that is related to that class. 

As for creating a custom tool, I suggest you to rather create a custom dialog (http://demos.telerik.com/aspnet-ajax/editor/examples/customdialogs/defaultcs.aspx) that enables the end-user to add custom CSS classes to the dropdown by adding the custom CSS rules that would be needed in the content area.

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
miksh
Top achievements
Rank 1
Iron
answered on 14 Sep 2015, 03:46 PM

I see, thanks.

I wonder is there any chance to combine the styles from an external css file with the css elements defined in the tools.xml or in the code?

0
Ianko
Telerik team
answered on 15 Sep 2015, 04:42 AM
Hello,

If you refer to CssClasses collection, yes, you can. This is described in this help article—http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/functionality/toolbars/dropdowns/css-styles.

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Editor
Asked by
miksh
Top achievements
Rank 1
Iron
Answers by
Ianko
Telerik team
miksh
Top achievements
Rank 1
Iron
Share this question
or