CuteEditor via AJAX

  •  12-17-2008, 12:45 PM

    CuteEditor via AJAX

    I have successfully used CuteEditor before in static pages.
     
    Now what I'm trying to do is load a CuteEditor, dynamically via AJAX.
     
    The user is going to click a button that says "View Customer Notes".
     
    The javascript is going to send an AJAX request like this:
        new Ajax.Request("modules/reserve/client_notes.php", {
          parameters: "cust=" + cust_num + "&recnum=" + cust_recnum,
          onSuccess: Reserve.gotReport.bind(this),
          onFailure: Reserve.gotFailure.bind(this)
          });
    client_notes.php has the following in it:
     
    require("../../core/CuteEditor_Files/include_CuteEditor.php");
    $cEditor = new CuteEditor();
    $cEditor->ID = 'rcvIntNotes';
    $cEditor->AutoConfigure = CoachFlex;
    $cEditor->FilesPath = "../../core/CuteEditor_Files";
    $cEditor->ShowCodeViewToolBar = false;
    $cEditor->ThemeType = "Office2003_BlueTheme";
    $cEditor->UseFontTags=false;
    $cEditor->Width = "500px";
    $cEditor->Height = "150px";
    $cEditor->EditorOnPaste = "PastePureText";
    $cEditor->EditorBodyStyle = "font: normal 0.75em Arial;";
    $cEditor->BreakElement="Br";
    $cEditor->EnableStripScriptTags=true;
    $cEditor->ShowPreviewMode = false;
    $cEditor->ShowTagSelecter = false;
    $cEditor->MaxHTMLLength = 65535;
    $editor .= $cEditor->GetString();
    $cEditor = null;
    $result = array();
    $result['header'] = '';
    $result['table'] = $editor;
    $result = json_encode($result); 
    header("Content-Type: application/json");
    print $result;
    exit(0);
     
    then the processing Javascript is:
      var json = transport.responseJSON;
      $('scrollbar_content').update(json.table);
      $('resNameRightTop').update(json.header);
     
     
    What i expect to happen is the "scrollbar_content" div to be filled with a CuteEditor.
    What happens is I get a white box that says:"

    Not Found

    The requested URL /CuteEditor_Files/template.php was not found on this server.
    "
     
    For some reason it doesn't seem to be placing the "FilesPath" in the look for template.php?
     
    Can someone help me figure this out?
     
    Thanks,
    -David
     
     
View Complete Thread