| Page 1 of 3 | [ 24 posts ] | Go to page 1, 2, 3 Next |
|
I am not sure if this is a problem with the datatable cell editing function or with the container/panel modal setting.
I am trying to setup a datatable in a modal, doing this by configuring the outside div as a panel, then defining another nested div inside the container div. The datatable shows properly, but when trying to use the cell editor the textbox will not take any keystrokes. Simply changing the container to "modal:false" and it seems everything renders properly. Is this possibly a bug with a zindex someplace? (probably my implementation of the components, but I have spent a few days on this) I can provide links to test pages if necessary. Thanks John |
|
The cell editor has a z-index of 9000 while the mask for modal panels has a z-index of only 3.
I think that the problem is that the modal panel subscribes to the focus event on anything that can receive the focus and resides outside of the panel. Cell editors, are created under document.body so they are outside of the panel itself. I would believe it is another symptom of the same bug that causes the following bug: http://yuilibrary.com/projects/yui2/ticket/2528671 |
|
Try this and let us know how it works. After the DataTable is created, add the following code:
YAHOO.util.Dom.getElementsByClassName('yui-dt-editor','div',document.body,function(el) { myDataTable.getTableEl().parentNode.appendChild(el); }); (assuming myDataTable is a reference to the datatable and would be accessible by closure within the function) What this does is to move the cell editor from document body to right after the DataTable table HTML element, thus, to within the same panel. Please do confirm if this works because it might help fixing the bug sooner. |
|
This will work and it allows me to enter values now, but it creates the editor window 1 cell down. Strange, probably easily fixed.
here is a link to my testing server, the window will be up on launch, click the max_entries cell to launch the editor. http://wheretoracerc.dyndns.org/~johngeffe/fb/test2.php Thanks |
|
I'm afraid I can't reach that page so I can't see it.
I only tested moving the cell editor in a plain DataTable without any panels and it worked nicely, with no strange offsets. I guess it must be some CSS style adding some extra margin somewhere. I'll add a reference to this thread to the original bug report. Thanks. |
|
Satyam,
I fixed the problem with dyndns.org ... the link should work now (hopefully). I did try removing the all excess css and it still does the same thing. I am currently searching to figure out if I add a listener to when the editor is rendered and then do an offset to x and y. Getting closer. Thanks again and again, you really add a lot of value to the YUI components for those of us that are not very good with Javascript. |
|
Add the following:
YAHOO.widget.BaseCellEditor.prototype.move = function() { // Move Editor var elContainer = this.getContainerEl(), elTd = this.getTdEl(); Dom.setStyle(elContainer,'display',''); Dom.setXY(elContainer,Dom.getXY(elTd)); }; That is the function that positions the cell editor. setXY can't be used on an element that is not visible so they try to do the calculations by other means, which fail in this case. setXY/getXY is safe, but only works on containers which are visible. |
|
Thanks,
With a bit of tweaking (adding the full reference to the YAHOO.util.Dom ) it works prefect. I feel guilty taking up so much of your time on this. Enjoy your evening. |
|
Sorry about the Dom shortcut, I'm so used to have it that I didn't even think about that.
Guilty? No way! We all contribute to make YUI. I could not have tested the patches without the sample code you provided and the YUI team has better information thanks to that. And the same as we've done in this case, other people is doing it in their scenarios. We all enjoy the benefits of it all. Personally, I enjoy this much more than playing, say, chess. Cheers |
|
This worked for me too, thanks for all the work.
|
| Page 1 of 3 | [ 24 posts ] | Go to page 1, 2, 3 Next |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group