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

ApplyClass Tool - Three Questions

4 Answers 52 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dan Ehrmann
Top achievements
Rank 1
Dan Ehrmann asked on 15 Mar 2012, 11:24 PM
I am just starting to use the ApplyClass tool, and I have three questions.

First, In the documentation, it says that the dropdown will be filtered based on the type of element which is selected. For example, if I select a link element in the content area, the dropdown should include only global styles and styles with selectors starting with "a." However, it also includes styles starting with "img." and all others. The same behavior occurs in the demo. Am I misunderstanding something? (FYI - I am using CssFiles.Add() to attach a single css file to the editor).

Second - in IE, when an image or block element is selected, selection handles appear. When the selected element is positioned under the dropdown, these handles show through, making it hard to read. This does not occur in Firefox. Is it possible to fix this?

Finally, I would like to add a few classes with CssClasses.Add() after using CssFiles.Add(). However, CssClasses.Add() resets the list. It would be nice to have an option to avoid resetting the list, so I can append, rather than replace. In my situation, I can't just add the classes I need to the external css file.

4 Answers, 1 is accepted

Sort by
0
Dan Ehrmann
Top achievements
Rank 1
answered on 16 Mar 2012, 05:07 PM
Another question to add to my first three - I have several css files that I want to apply to the editor content, but I only want styles from one of them to appear in the 'apply class' dropdown. Is there any way to do this other than parsing the css file and using CssClasses.Add()? Is there a way to do it client side, rather than server side?
0
Rumen
Telerik team
answered on 20 Mar 2012, 11:32 AM
Hello,

1) The tool that offers this functionality was introduced in Q1 2012 and its name is Format Sets (not ApplyClass). You can test its demo here. The Apply Class dropdown always displays all styles in the page, except when the CssClasses property is not set.

2) The hasLayout handlers are Internet Explorer specific and this feature is not offered by any other browser. They are windowed elements which have higher z-index than all HTML elements that is why they appear over the HTML dropdown. The only way to hide them is to remove the following CSS properties from the selected content:

CSS property Value
display inline-block
height any value
float left or right
position absolute
width any value
-ms-writing-mode tb-rl
zoom any value

3) CssClasses and CssFiles resets the available CSS classes in the dropdown on purpose. The CssClasses is used to restrict the available classes and display only the desired ones.
The CssFiles property is used to stop the population of page CSS styles in RadEditor and its content area. Once it is set the editor will not pick up the styles from the page and will read only the classes specified in this external CSS file. You can define all classes that you want to appear in the dropdown in this CSS file(s) imported through the CssFiles property.

4) The only way to restrict the classes populated in the dropdown is through the CssClasses property. Another approach is to load a file containing only the desired CSS classes.

Greetings,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Dan Ehrmann
Top achievements
Rank 1
answered on 20 Mar 2012, 02:36 PM
Thanx Rumen - I think FormatSets is exactly what I was looking for. I guess I will have to upgrade to Q1 2012!
0
Rumen
Telerik team
answered on 21 Mar 2012, 04:57 PM
Hello,

Yes, the FormatSets tools is currently offered only by the Q1 2012 version of RadEditor for ASP.NET AJAX and if you want to use it, you will need to upgrade.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Dan Ehrmann
Top achievements
Rank 1
Answers by
Dan Ehrmann
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or