xhEditor is a simple,small,fast WYSWYG(What You See What You Get) XHTML editor based by jQuery. that is webbased and compatible with Internet Explorer 6.0-8.0,Firefox 3.0,Opera 9.6,Chrome 1.0,Safari 3.22 .
xhEditor是一个基于jQuery开发的简单迷你并且高效的可视化XHTML编辑器,基于网络访问并且兼容IE 6.0-8.0,Firefox 3.0,Opera 9.6,Chrome 1.0,Safari 3.22。
protected/extensionsSee the following code example:
$this->widget('application.extensions.xheditor.JXHEditor', array( 'model' => $model, 'attribute' => 'content', 'htmlOptions'=>array('cols'=>80,'rows'=>20,'style'=>'width: 100%; height: 500px;'), ));
Total 13 comments
Because xhEditor creates an iframe out of the input field, there's a trick to accessing the field via Selenium: you need to switch the frame.
Regarding C.attr("class") is undefined error -
Actually there's javascript error which stops script from working. Javascript does not find textarea (field to be edited) that has 'class' attribute 'xheditor'. So you should add 'class' attribute manually.
What you need to do is -
In file protected\extensions\xheditor\JXHEditor.php Add line (in line 43):
$this->htmlOptions['class']='xheditor';
right before :
if($this->hasModel()) echo CHtml::activeTextArea($this->model,$this->attribute,$this->htmlOptions); else echo CHtml::textArea($name,$this->value,$this->htmlOptions);
hi i got error C.attr("class") is undefined
The path is wrong when using this extension with theme, result: www.mysite.com/undefinedxheditor_skin/o2007blue/ui.css www.mysite.com/undefinedxheditor_skin/o2007blue/iframe.css
result the 2 css file not found: ui.css and iframe.css
To disable the annoying unload event, just open the file "xheditor/xheditor-en.js" and comment the following line (197)
jpWin.unload(_this.getSource).bind('beforeunload', _this.getSource);
Dont forget to remove the already published assets files and enpty browser cache before testing
I fixed the error "model attribute undefined !!," but now i want to upload a file using the upImgUrl attribute:
'upImgUrl' => 'create' // create is the action name in the controller
In my controller i have this:
$model=new Item; if(isset($_POST'Item')) { $model->attributes=$_POST'Item'; $model->image=CUploadedFile::getInstance($model,'image'); if($model->save()) { $model->image->saveAs('./myfiles'); } } $this->render('create', array('model'=>$model));
but i have this following error: create upload interface error
Do you have an idea how i can solve this or an example showing how to upload a file using the xheditor in Yii?
Thanks
I copy paste the sample and i get this error !!! If you don't give a documentation, at list give an working exemple to permit to try this control.
Hi,
First error i get is model attribute undefined !!,
There's a good example which explain how to use JXHEditor? and saving the content in the database, etc.
Thanks
When I submit the form, it warns that we're leaving the page.... how to disable that.
i think it is jquery 1.4.1 take the message, you can download xheditor1.0beta(for jquery1.4.1) to try
When I submit the form, it warns that we're leaving the page.... how to disable that.
I had to edit the class file: class JXHEditor extends widget to class JXHEditor extends CWidget
Anyway...nice work;) 5 stars.
Now it's a 5 stars extension...
It works great...thanks for this! :D Had to see the source file to get how to use it:
/** * JXHEditor class file. * * @author jerry2801 <jerry2801@gmail.com> * * A typical usage of JXHEditor is as follows: * <pre> * this->widget('application.extensions.xheditor.JXHEditor', array( * 'model' => $model, * 'attribute' => 'intro', * 'options' => array( * 'width' => '100%', * 'height' => 400, * ), * )); * </pre> */Now using it... Please give some basic documentation...
Leave a comment
Please login to leave your comment.