-
16 Feb 2012 2:29 AM #1
Problem - Add upload file button to an html Editor
Problem - Add upload file button to an html Editor
Hello every one,
As explained in the title, i want to add the possibility to upload images in a directory and add the html code of my image in the text.
I trie this example but the button is not visible.
i think i can't add a form in my toolbar.Code:Ext.onReady(function (){ Ext.ns('Ext.ux.form.HtmlEditor'); var w = new Ext.Window({ width: 860, layout: 'fit', items: [ { fieldLabel: 'Description', name: 'description', value: 'bwah bwah', anchor: '100%', id:'monHtmlEditor', xtype: "htmleditor", height: 400, listeners:{ afterrender:function(){ this.getToolbar().addItem( [ { xtype: 'form', id: 'monForm', url: 'php/webServiceProjet.php?upload=1', border: false, fileUpload: true, items:[ { xtype: 'fileuploadfield', id: 'monFileUpload', name: 'monFileUpload', buttonOnly: true, hideLabel: true, buttonText: '', tooltip: 'monFileUpload', buttonCfg: { iconCls: 'bo' } /* xtype: 'button', iconCls: 'bo', //your iconCls here handler: function(){ alert('eee'); //this.cmp.insertAtCursor('<hr>'); }, scope: this, tooltip: 'horizontal ruler', overflowText: 'horizontal ruler' */ } ] } ] ) } } } ] }); w.show(); });
is there a solution to upload images via the htmlEditor?
Thank you in advance for your replies.
-
16 Feb 2012 4:47 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
You can add your own tool to the editor.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Feb 2012 5:25 AM #3
Thank you for your replay.
could you please give me an axample?
i added a button this way:
I can add an image to my text, but what i want is to display a pop-up to select a document.Code:this.cmp.getToolbar().addButton([{ iconCls: 'bo', handler: function(){ this.cmp.insertAtCursor('<img src="./img/test.png'); }, scope: this, tooltip: 'horizontal ruler', overflowText: 'horizontal ruler' }]);
thank you again.


Reply With Quote