Dojo dijit.Editor tabbing
I want to provide javascript editing with highlighting in my web page. I am looking around for a good text area and I found dijit.Editor, however, I also need to have tabbed browsing for different files (a.js , b.js , c.js , ... , z.js). dijit.Editor seems to have tabs along the top (see here) but I can't tell if those are built in, or if they can be assigned.
Can someone please either answer my question, or开发者_如何学编程 recommend a different editor to use. Cheers
If you're referring to the "Demo, Copy&Paste, Javascript" tabs in the demo windows, those are not part of dijit.Editor. They're merely part of the demonstration engine Dojo uses for its widgets. The Editor widget is just the toolbar of buttons and textarea beneath it.
The tabs in those demos are most likely a dijit.layout.TabContainer
tab widget.
I've used dijit.Editor
in a few projects and find it to be extremely flexible. The other major benefit is its close integration to the rest of the Dojo toolkit and Dijit widgets. The API is very consistent and well-organized across the Dojo platform, and you won't muchfind yourself searching for plugins of varying quality as with jQuery.
see discussion here
dijit.Editor is based on contentEditable and while that's great for rich text editing and short snippets of text, it is not the ideal text editor for code. The underlying browser mechanism for contentEditable doesn't scale particularly well for long files, and there's unnecessary wiring for rich text, variable spacing and such. I have seen a couple of people build an editor out of dijit.Editor and dojox.highlight and you may find that sufficient (sorry, I don't remember exactly where ATM)
精彩评论