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

Drag Drop Text from RadListBox as complete Object in RadEditor

1 Answer 62 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Adeel
Top achievements
Rank 1
Adeel asked on 30 Oct 2014, 02:07 PM
Hello,

I have used RadListBox and RadEditor for Drag and drop functionality.

Scenario 1: I dragged "SomeText" from RadListBox and dropped in the RadEditor. When i press BACKSPACE, it only removes the "t" from the dropped Item "SomeText" and it becomes "SomeTex" in the RadEditor.

What I want is When its is dropped in the editor it should be treated as a complete object and if i press BACKSPACE, the whole item "SomeText" Should be removed from the RadEditor instead of just "t". How Can i do it.. .. ..

Scenario 2 : Is it possible to drag the item and drop it on the current Mouse position in the RadEditor, instead of Cursor position.

 

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 04 Nov 2014, 07:13 AM
Hello Adeel,

When a simple text element is dropped in editable container, i.e., the editor, it is expected this text to be considered as plain text and be able to be deleted as expected.

If there is need for this element to be considered as special, additional logic should be implemented for such behavior. The drop event should be handled, and also, the dropped element should be added as Immutable Element. By that this element will be created as non-editable in the editable scope. You can examine this example:
<telerik:RadEditor runat="server" ID="RadEditor1" EnableImmutableElements="true">
    <Content>
        <div contenteditable="false" unselectable="on">some text</div>
    </Content>
</telerik:RadEditor>

You will see that the inserted text element is not editable any more, although it can only be removed by selecting all (Ctrl+A, and delete or backspace). Additional behavior of the Immutable Elements in the RadEditor should be further implemented as a custom solution based on the requirements.

There is no OOB logic that will allow the whole element to be deleted on one key press.


As for the second requirement, the editor's content area is a simple HTML document, and such scenario can only be handled via custom JavaScript logic for DOM manipulation. Such matter is discussed in this Stackoverflow forum thread. Implementing this scenario in the RadEditor content area is similar to working with plain HTML documents. Although, in the terms of Editable content, I can only make assumption how such functionality would be designed and how should it act.


Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Adeel
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or