I have a fairly complicated scenario that I can't seem to sort out.
We are using a RadEditor control to allow users to enter Text Ads in a fixed DIV area. To do this we are setting up the Content area of the RadEditor something like this:
In the code behind we set the allowed dimensions of the Div's.
When a User enters text, it looks something like this:
Then the user selects say the first Line and uses the Center Justify tool on the tool bar.
Problem - this justifies all of the lines!
Playing around, I found that if we change the NewLineMode to "P" or "Div" - then the Center Justify works as desired, but introduces a new problem. It closes the contentEditable <div> tag, then replicates it for the new Div or P tag.
Example:
This breaks things.
What I am trying to get it to do is insert <p> or <div> tags inside the editable <div> - without hijacking it.
I tried adding a fourth nested <div>, but no luck.
Any help would be great.
Dan
We are using a RadEditor control to allow users to enter Text Ads in a fixed DIV area. To do this we are setting up the Content area of the RadEditor something like this:
<Content> <div id="textContainer" contenteditable="false" unselectable="on"> <div id="paddingContainer" contenteditable="false" unselectable="on"> <div id="classifiedArea" contenteditable="true" unselectable="off"> </div></div></div></Content>In the code behind we set the allowed dimensions of the Div's.
When a User enters text, it looks something like this:
<div id="textContainer" contenteditable="false" unselectable="on"> <div id="paddingContainer" contenteditable="false" unselectable="on"> <div id="classifiedArea" contenteditable="true" unselectable="off" style="width: 172.8px; font-family: HELVETICA; font-size: 14px; line-height: 22px; min-height: 22px;">Line 1<br>Line 2<br>Etc</div></div></div><!-- End -->Then the user selects say the first Line and uses the Center Justify tool on the tool bar.
Problem - this justifies all of the lines!
Playing around, I found that if we change the NewLineMode to "P" or "Div" - then the Center Justify works as desired, but introduces a new problem. It closes the contentEditable <div> tag, then replicates it for the new Div or P tag.
Example:
<div id="textContainer" contenteditable="false" unselectable="on"> <div id="paddingContainer" contenteditable="false" unselectable="on"> <div id="classifiedArea" contenteditable="true" unselectable="off" style="width: 172.8px; font-family: HELVETICA; font-size: 14px; line-height: 22px; min-height: 22px;">Line 1</div><p id="classifiedArea" contenteditable="true" unselectable="off" style="width: 172.8px; font-family: HELVETICA; font-size: 14px; line-height: 22px; min-height: 22px;">Line 2</p><p id="classifiedArea" contenteditable="true" unselectable="off" style="width: 172.8px; font-family: HELVETICA; font-size: 14px; line-height: 22px; min-height: 22px;">Line 3</p></div></div>This breaks things.
What I am trying to get it to do is insert <p> or <div> tags inside the editable <div> - without hijacking it.
I tried adding a fourth nested <div>, but no luck.
Any help would be great.
Dan
