jQWidgets Forums
Forum Replies Created
-
Author
-
Oh, and also, thanks for pointing out the vertical alignment on the dropdownlists. I think I may have to re-think how the toolbar is rendered to fix this. At the moment, it creates a bunch of items and then appends them to the toolbar which I think stuffs the jqx method calls as the elements are not positioned in the DOM correctly at that point. I need to create, then append, then call the jqxDropDownList method.
Already well into switching to jqxWindow, mate.
Strike is now fixed, just missed it in my element->command map. Same with hyperlinks. Justify commands are a bit different though as with those I will actually have to decipher the style attribute on elements. Bold, italic, etc are block elements and easy to handle. Getting there though.
Also, the buttons below the editor are not part of the editor. They are only part of my demo to test external method calls, such as:
$('#editor').jqxEditor('save');
or
$('#editor').jqxEditor('print');
I’m also planning on building some sort of image browser so make inserting images even easier. That may come a bit later though.
Peter,
I have figured out why it looks weird in IE7 and IE8. Seems if you iterate over an array it includes the ‘indexOf’ method in the loop. I think it’s cool that you’re adding indexOf for implementations that don’t have (I have used it in a few places), it’s just weird that a for loop has decided that it is an iteratable item. Anywayz, the end result was an extra toolbar and an extra toolbar item in each toolbar that wasn’t meant to be there.
IE7 not working was just me being silly and leaving a comma in the wrong place.
Events are now consistent. Turns out IE only triggers a ‘selectstart’ event when, you know, a selection starts. Whereas in FF and Chrome it’s triggered pretty much along with the ‘mousedown’ event. Fixed by just listening for mousedown events on both instead. Works nice.
So yeah, check it out when you can. I’m just finishing off the toolbar sync but for the most part, everything seems to be working consistently across all browsers now, all the way back to IE7.
Let me know if you spot anything else.
Jamie
Peter,
Yeah, the IE integration is a pain. I’ll do some more testing in my VM tomorrow for the event stuff.
The image resize thing though is an IE only thing. It’s actually not implemented in Chome at all. This is the ‘enableObjectResizing’ command. See http://tifftiff.de/contenteditable/compliance_test.html for compatibility and some idea of the mess that I’m having to deal with. I’m going to try and do the image resize handling in the widget itself if it’s possible. Most other widget framework editors don’t have image resize either anyway.
I’ve also made it so it can be made from either a DIV or a TEXTAREA so it’s up to the developer. If using a TEXTAREA the only thing they gain is the ability to automatically submit the editor content as part of a form submit. If it’s just a DIV, I have exposed a ‘save’ event and method so that a $.post call can be made to save content. Hopefully that’s flexible enough.
I’ll keep plugging on with the IE integration though. IE just really does things differently to every other browser, so finding methods that work in all browsers is my challenge at the moment. IE 10 looks fine for me though, so now it’s just a matter of working backwards.
J
Hi Peter! Almost done! I now have everything consistently working in all browsers. Phew, that was a pain in the butt.
Anwayz, quick question. What is the correct method for passing through events from the editor element?
Right now, I have used addHandler() for things like keydown with simple functions that just use a _raiseEvent method to trigger the event on the host object. Is that correct? Or is there a built in way to simply say keyup/down events should be triggered automatically?
Updated.
* Now has jqxColorPickers for forecolor and backcolor.
* Toolbars are now grouped so similar items can be kept together.
* Removed cut, copy and paste as they are usually restricted from JavaScript and just didn’t work. (CTRL-C, CTRL-X and CTRL-V will still work).
* Added hyperlinksI think the only major thing left to do is sync the editor with the toolbar so, for example, bold is selected on bold text, colorpicker is updated, etc. Oh, that and getting it working Internet Excreter.
Thanks for the tips Peter.
I actually have used jqxColorPicker now. In the interest of showing something faster I initially used a simple jqxComboBox to start. I’ll push it out to the demo site once it’s all working properly (minor tweaks to go).
I haven’t tested IE. Apprently there is something I need to do differently when activating the contentEditable attribute. I read it in the spec, but I don’t have IE at the moment so I’ll have to figure that one out later.
Jamie
Hi!
I’ve got a little bit of a demo page going on. Slowly getting through adding the required features in between doing actual real work.
Demo is at: http://www.hazaarmvc.com/site/test
Hopefully I’m heading in the right direction.
Thanks for getting back to me Peter. Well actually, today I decided I needed a new challenge so I’ve been working on making my own ‘jqxEditor’ plugin. It’s coming along slowly but quite nicely. I’m using existing widgets as a start point/reference so I’m trying to keep the code in-line with those.
So far I have a simple toolbar (currently with only Bold, Italic, Underline and Strike), and an editor pane. I can type text and retrieve HTML using a call to $().jqxEditor(‘val’).
I’d be more than happy to submit some code to you if you deem it worthy.
I’ll let you know how I get on.
May 9, 2013 at 4:30 am in reply to: Custom dropdownlist editor does not seem to honour valueMember Custom dropdownlist editor does not seem to honour valueMember #20802Thanks Peter.
Just ignore the missing source thing. I was patching together an example from my PHP wrapper and must have just missed some stuff.
The fix was actually quite simple. The column definition was just missing some attributes. The key was using ‘datafield’ and ‘displayfield’. As soon as set both of those correctly, everything just started working.
Thanks.
-
AuthorPosts