araujoadanr Posted November 29, 2020 Posted November 29, 2020 I am trying to save the text written in the TinyMCE in a Dataset, but I am not succeeding. I have downloaded some examples, and prepared an example. Somebody could help me? This example use ClientDataset. TinyMCEdemoDB.zip Quote
Sherzod Posted November 30, 2020 Posted November 30, 2020 3 hours ago, adan200 said: This example use ClientDataset. Hello, I don't see that you are using ClientDataSet. Quote
araujoadanr Posted November 30, 2020 Author Posted November 30, 2020 Hello, thanks for answering. In my production project I use SDAC, But not everyone uses this component, that's why I prepare the test case with ClientDataset, but I can prepare with another data access component, which seems more appropriate. 1- Button 1 creates the dataset in memory 2- Buttons 2, try to add the text using two methods that I found in the forum. Quote
Sherzod Posted November 30, 2020 Posted November 30, 2020 OK. CDSText.Append; UniSession.AddJS('ajaxRequest(MainForm.form, "mce", ["text="+tinyMCE.get("ed1").getContent()])'); CDSTextMemo.Value := HTMLmce; CDSText.Post; When you initialize TinyMCE, you should use the TinyMCE events, such as "change", to send the modified data to the server. Quote
araujoadanr Posted November 30, 2020 Author Posted November 30, 2020 Do you have an example? I don't know much about client side events. Quote
Sherzod Posted November 30, 2020 Posted November 30, 2020 2 hours ago, adan200 said: Do you have an example? I don't know much about client side events. I will try... Quote
Sherzod Posted November 30, 2020 Posted November 30, 2020 13 hours ago, adan200 said: Do you have an example? I don't know much about client side events. Hello, You are using version 3, try this: 1. <textarea id="ed1" style="width: 100%; height: 400px;"></textarea> <script> tinyMCE.init({ theme : "advanced", plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", // Theme options theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, extended_valid_elements : "img[class=myclass|!src|border:0|alt|title|width|height]", mode: "exact", elements : "ed1", onchange_callback : function() {ajaxRequest(MainForm.form, "mce", ["text="+tinyMCE.get("ed1").getContent()])} }); </script> ... Quote
araujoadanr Posted November 30, 2020 Author Posted November 30, 2020 Millions of thanks. You are a genius. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.