PDA

View Full Version : [CLOSED] HtmlEditor.Call("append", "xxx") does not work



hdsoso
Feb 17, 2014, 12:31 AM
my ext.net version is 2.4


protected void MultiUpload1_FileUpload(object sender, FileUploadEventArgs e)
{
he_cont.Call("append", "ssssssssss");//the code can not work well, when i click upload button and selected a pic, there is no "ssssssssss" in the HtmlEditor,why?
}



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm20.aspx.cs" Inherits="extdemo.test.WebForm20" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" ></ext:ResourceManager>
<ext:MultiUpload ID="MultiUpload1" runat="server" AnchorHorizontal="25%" AutoStartUpload="true"
FileDropAnywhere="true"
FileSizeLimit="15 MB"
FileTypes="*.jpg;*.png;*.gif"
FileTypesDescription="All Files"
FileUploadLimit="100"
FileQueueLimit="0" OnFileUpload="MultiUpload1_FileUpload">
<Button>
<ext:Button ID="btn_upload" runat="server" Text="上传图片..." />
</Button>
<Listeners>
<UploadStart Handler="Ext.Msg.wait('上传中');" />
<UploadComplete Handler="Ext.Msg.hide();" />
</Listeners>
</ext:MultiUpload>
<ext:HtmlEditor runat="server" ID="he_cont" FieldLabel="内容" AnchorHorizontal="100%" AnchorVertical="-112"></ext:HtmlEditor>
</form>
</body>
</html>

Daniil
Feb 17, 2014, 5:21 AM
Hi @hdsoso,

Thank you for the report. Fixed in the trunk, revision #5669. It will go to the v2.5 release.

Now you can call an htmlEditor's Append method.

this.HtmlEditor1.Append("the text to append");

hdsoso
Feb 17, 2014, 7:19 AM
Hi @hdsoso,

Thank you for the report. Fixed in the trunk, revision #5669. It will go to the v2.5 release.

Now you can call an htmlEditor's Append method.

this.HtmlEditor1.Append("the text to append");


it can be used in code behind if i use v2.4 release?

Daniil
Feb 17, 2014, 7:31 AM
No, it cannot.

But you can add the JavaScript methods for HtmlEditor and still use:

this.HtmlEditor1.Call("append", "text");

hdsoso
Feb 17, 2014, 9:06 AM
No, it cannot.

But you can add the JavaScript methods for HtmlEditor and still use:

this.HtmlEditor1.Call("append", "text");

i mean if i use 2.4 version , how to do?

Daniil
Feb 17, 2014, 12:31 PM
Please add this script into a page's <head>.

Ext.form.field.HtmlEditor.override({
append: /* please take the code from the SVN revision #5669 */
appendLine: /* please take the code from the SVN revision #5669 */
});
and still use:

this.HtmlEditor1.Call("append", "text");

hdsoso
Feb 18, 2014, 12:36 AM
Please add this script into a page's <head>.

Ext.form.field.HtmlEditor.override({
append: /* please take the code from the SVN revision #5669 */
appendLine: /* please take the code from the SVN revision #5669 */
});
and still use:

this.HtmlEditor1.Call("append", "text");
thanks.work perfect.