| function addEvent(evnt, elem, func) |
| { |
| if (elem.addEventListener) // W3C DOM |
| elem.addEventListener(evnt,func,false); |
| else if (elem.attachEvent) // IE DOM |
| { |
| var r = elem.attachEvent("on"+evnt, func); |
| } |
| return r; |
| } |
| addEvent(window.onload,load()); |
| function load() |
| { |
| var comboClass = $find("<%= rcClass.ClientID %>"); |
| var comboCountry = $find("<%= rcCountry.ClientID %>"); |
| var comboTm = $find("<%= rcTrademark.ClientID %>"); |
| var comboYearFrom = $find("<%= rcYearFrom.ClientID %>"); |
| var comboYearTo = $find("<%= rcYearTo.ClientID %>"); |
| var comboType = $find("<%= rcType.ClientID %>"); |
| var treeClass = comboClass.get_items().getItem(0).findControl("TreeClass"); |
| var treeCountry = comboCountry.get_items().getItem(0).findControl("TreeCountry"); |
| var treeYearTo = comboYearTo.get_items().getItem(0).findControl("TreeYearTo"); |
| var treeYearFrom = comboYearFrom.get_items().getItem(0).findControl("TreeYearFrom"); |
| var treeTrademark = comboTm.get_items().getItem(0).findControl("TreeTrademark"); |
| setText(comboClass,treeClass,0); |
| setText(comboCountry,treeCountry,2); |
| setText(comboTm,treeTrademark,1); |
| setYear(comboYearFrom); |
| setYear(comboYearTo); |
| } |
| function onBeforeClose(sender, arg) |
| { |
| function callbackFunction(arg) |
| { |
| if (arg) |
| { |
| sender.remove_beforeClose(onBeforeClose); |
| sender.close(); |
| } |
| } |
| arg.set_cancel(true); |
| radconfirm("Are you sure", callbackFunction, 300, 100, null, "Close RadWindow"); |
| } |
| //this function call a window when I click a menu item |
| function menuClick(sender,arg) |
| { |
| //show window .... |
| //.... |
| //this comment lines not work, I try both |
| //wnd.add_beforeClose(onBeforeClose); |
| //sender.add_beforeClose(onBeforeClose); |
| //but this work. its a closing event not before close |
| wnd.add_close(onBeforeClose); |
| } |
I have a small app that uses the radeditor. In it I insert pictures into the editor’s document by pasting some HTML using the pasteHTML method.
Wht I paste is normaly this image tag or similar one:
"<img alt="" id="Tempdivphoto0" src="PhotoFeeders/GetNewTempForumPostPhotoThumbNail.aspx?ForumPostTempPhotoIndex=0&Time=1238702704906" />"
When the user submits the document, my application then has to change all the <img> tags that were pasted into <div> tags. I dothis in javascript with this small function:
The id of the <img> tag is in this: $find(element).get_TempID()
Posteditor is the clientID of the editor
if
($get($find(element).get_TempID(), $find(Posteditor).get_document()) != null) {
var temImg = $get($find(element).get_TempID(), $find(Posteditor).get_document());
var div = $find(Posteditor).get_document().createElement("div");
var uniqueIDv = this._UniqueID;
div.id = uniqueIDv + index.toString();
div.className =
'ForumPostPhotoDivCss';
$find(Posteditor).get_document().body.insertBefore(div, temImg);
$find(Posteditor).get_document().body.removeChild(temImg);
The problem I am having is this:
If the user only types some text and pastes images then the HTML of the editor looks something like this and all works fine:
this is a test<br />
<br />
<img alt="" id="Tempdivphoto0" src="PhotoFeeders/GetNewTempForumPostPhotoThumbNail.aspx?ForumPostTempPhotoIndex=0&Time=1238702704906" />
However, if the user selects the entire content of the editor and decides to align it ‘centre’ then the HTML in the editor looks like this and it does not work because of the <p align="center"></p> tag surounding it.
<p align="center">this is a test<br />
<br />
<img alt="" id="Tempdivphoto0" src="PhotoFeeders/GetNewTempForumPostPhotoThumbNail.aspx?ForumPostTempPhotoIndex=0&Time=1238702704906" /> </p>
The same problem occurs when the user selects the content of the editor and puts it in bold, then it wraps it up in these <strong></strong> tags an it also does not work.
<strong>this is a test<br />
<br />
<img alt="" id="Tempdivphoto0" src="PhotoFeeders/GetNewTempForumPostPhotoThumbNail.aspx?ForumPostTempPhotoIndex=0&Time=1238702704906" /></strong>
The error is this line:
$find(Posteditor).get_document().body.insertBefore(div, temImg);
Where it says:
Error: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "http://localhost:1761/BCW_Web/Scripts/ForumsAJAX.js Line: 369"]
Source File: http://localhost:1761/BCW_Web/Scripts/ForumsAJAX.js
Line: 369
How can I reference the div and/or the image correctly when they are wraped inside <strong> or <div> tags?

Hi All
protected
void rgvReport_OnExcelExportCellFormatting(object source, ExcelExportCellFormattingEventArgs e)
{
if (e.FormattedColumn.HeaderText == "Date")
e.Cell.HorizontalAlign =
HorizontalAlign.Center;
}
This coding is for setting the alignment for a field with heading "Date" to center in excel.
I there any option like this for changing the alignment in pdf
Same thing to make the field with heading "Date" to center.
-Anto