Hi,
I basically drag and drop the webtexteditor to the drag drop framework.
but the webtexteditor doesnot show up.
here is my code.
<%
%>
="Infragistics35.WebUI.UltraWebCalcManager.v10.1, Version=10.1.20101.1011, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
<!
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
="http://www.w3.org/1999/xhtml">
="server">
>
</
body
{
/
}
;
/>
="text/javascript">
Sys.Application.add_load(appLoaded);
appLoaded() {
$IG.DragDropBehavior();
);
count = list.childNodes.length;
i = 0; i < count; i++) {
child = list.childNodes[i];
(child.getAttribute)
ddb.addSourceElement(child);
ddb.addTargetElement($get(
ddb.addDragChannels([
]);
ddb.addDropChannels([
ddb.get_events().addDropHandler(dropHandler);
dropHandler(source, evntArgs) {
eleID = evntArgs.get_manager().get_source().element.id;
ddb = removeBehavior;
(!ddb) {
removeBehavior = ddb =
ddb.get_events().addDropHandler(removeHandler);
)) {
).innerHTML;
document.getElementById(eleID +
).innerHTML = parseInt(spanSource) + 1;
div.id = eleID +
div.className =
spanpre.innerHTML = eleID +
span.innerHTML =
span.id = eleID +
spanend.innerHTML =
img.src = evntArgs.get_manager().get_source().element.src;
img.style.width =
img.style.height =
img.align =
div.appendChild(img);
div.appendChild(spanpre);
div.appendChild(span);
div.appendChild(spanend);
panel.appendChild(div);
ddb.addSourceElement(div);
removeHandler(source, evntArgs) {
eleIDshort = eleID.replace(
(parseInt(spanSource) == 1) {
panel.removeChild(document.getElementById(eleID));
document.getElementById(eleIDshort +
).innerHTML = parseInt(spanSource) - 1;
">
="MultiLine">
Hi Smuddam,
I eventually reformatted attached codes and tested them.Note: please do not copy/paste from richtext sources like VisualStudio editor. If you want to provide codes, then you may attach a file into the Options tab. If codes are small, then you may temporary paste copied text into notepad, notepad++, or similar plain-text editor and copy/paste from that editor text-content only.
I guess in your application you copied/pasted codes from one of the samples which had IMG objects as targets and created their copies. You can not do a similar copy with a server generated control, because only single element per control can exist on client. However, you may move that element to another container using drag-drop.
If you want only to move editor to another location, then you may use built-in drag-drop action and there is no need in any channels, handlers, etc. For example:function appLoaded(){ var ddb = new $IG.DragDropBehavior(); var list = $get("imageList"); var count = list.childNodes.length; for (var i = 0; i < count; i++) { var child = list.childNodes[i]; if (child.getAttribute) ddb.addSourceElement(child); } ddb.addTargetElement($get("cartAreaDIV"), true); ddb.set_defaultDropAction($IG.DragDropAction.Append);}
Also adding all children of "list" as targets is not good idea, because WebTextEditor renders several hidden elements, which could not be moved anyway, but fill up your source container by dummies.
If you want to keep your architecture with channels and trash, then below are fixed codes for you. You can use all your original codes beside commented lines. If you do not use default drop action, then you are responsible for all moves (remove source from its old parent and insert it into new target).
function dropHandler(source, evntArgs){ ... if (document.getElementById(eleID + "_div")) ... else { ...// var img = document.createElement("img"); // img.src = evntArgs.get_manager().get_source().element.src;// img.style.width = "45px"; // img.style.height = "44px"; // img.align = "middle"; // div.appendChild(img);
var src = evntArgs.get_manager().get_source().element; src.parentNode.removeChild(src); div.appendChild(src);
div.appendChild(spanpre); ... }}