- Dec 28 6:51 AMI think the Date Editor would be the perfect model for your RTE editor since it uses the Calendar Control, which has quite a complex markup, as its editing control. You won't need to care much for any formatting since the plain formatter does nothing but insert whatever comes in the record field into the innerHTML of the cell, thus, no formatting is lost. However, you might have to work a little bit with the default cell styles, thus, formatting would be more of a CSS issue than of code. Alternatively, you might want to use a ToolTip to show the fully expanded text when the cursor is over a cell. This will spare you from having cells too big or having scroll bars. I have an example for that at: http://www.satyam.com.ar/yui/2.6.0/tooltips.html
Also, remember that you are free to add extra options to the constructor, just like the dropdown, radio or checkbox cell editors do, so you can pass any configuration option from the constructor of the cell editor instance straight to the RTE, plus, you might want to add some of your own such as number of lines or width or whatever. The RTE won't complain if it gets more configuration options than it needs, just make sure you don't use the same names so as not to confuse one set of options with the other. Another feature you might want to add is to place the Save button in the toolbar of the RTE. Drawing the cell editor buttons is a separate method which you may override to use your own way of doing it.
You might have to work a little with the move method, which positions the cell editor over the cell. You will probably don't want the RTE to have the same width as the column and, with columns close to the right border, you might want to align the top-right corner of the RTE to the cell. If you don't give it enough width, the toolbar will flow into the next line and it won't look nice.
There is a non-trivial issue with sizing and positioning. By the time the cell editor move method is called, the editor is still invisible. That means that some browsers will refuse to report position or size information about it. You might have to force it to become visible so you can get proper measurements. Do use the methods from the Dom utility, otherwise you will go crazy trying to compensate for different ways of measuring things. Try it out without making it visible, you will probably be fine, but just make a note that this might be an issue if you see something funny happening there.
El 28/12/2009 14:56, Brian McCullough escribió:
- << Previous post in topic Next post in topic >>