Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TD tag is hardcoded in cell method #651

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

speich
Copy link

@speich speich commented Jul 5, 2013

When using renderRow() to create other row structures (views) such as a gallery (see http://dojofoundation.org/packages/dgrid/demos/multiview/) the editor doesn't work anymore, because it uses the cell() method extensively. But the cell method expects the dom structure to be a TD. Wouldn't it be possible to replace that with a dojo/query call to the field class?

@kfranqueiro
Copy link
Member

I'm kind of curious as to the use case for this suggestion, since while it's common to customize renderRow for List (which doesn't support column plugins), it's not really expected for Grid, which indeed makes a lot of assumptions about using a table layout.

@speich
Copy link
Author

speich commented Jul 5, 2013

I'm working on a Windows Explorer like application which uses the dijit/tree and the dgrid to manage file and folders. I have a menu where you can change the view of the grid from list to icons like in the multiview demo linked above. Now, when I want to edit a file/folder name using the editor plugin I have to override the cell method because it assumes the cell to be a TD. If I replace the getElementsByTagName with getElementsByClassName everything works fine. If you are interested, I can create a demo where you can see what I'm talking about.

@kfranqueiro
Copy link
Member

That does sound tricky... A demo might be useful to try to come up with the best solution, yes.

I have serious reservations about this pull request, mainly because this solution won't work for any columns with className specified (which overrides the field-<field> class), but also because it incurs the weight of dojo/query solely for the sake of logic that in 99.9% of cases is already fine as-is.

@speich
Copy link
Author

speich commented Jul 7, 2013

I understand that you don't want to require in dojo/query just for that. What about just using getElementsByClassName together with has('ie') > 8?

The problem is not so much using a customized renderRow(), but that I would like to have additional content in a cell such as a folder icon. But the editor edits everything within a cell, which makes the icon disappear when editing. I noticed, that there is the property cell.content, but since cell() uses td explicitly that didn't help either.

I published a demo of the remoteFileExplorer on my website (still a work in progress). The code is available on github https://github.com/speich/remoteFileExplorer :

Right-click on a file/folder and chose 'rename' to edit a name. That works fine because I override cell() in https://github.com/speich/remoteFileExplorer/blob/master/js/grid/View.js#L62 But if you change the view to 'List' (Menu View -> List) and then also rename a file/folder the icon is removed and put back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants