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

Cell-Editor crashes on IE #366

Closed
ThomasEverding opened this issue Dec 10, 2012 · 7 comments
Closed

Cell-Editor crashes on IE #366

ThomasEverding opened this issue Dec 10, 2012 · 7 comments

Comments

@ThomasEverding
Copy link

In our project we use dgrid to dynamically create tables from user defined templates. When I run our code in IE9 and use the cell editor to change a value it crashes in editor.js line 209. The editor tries to access the parent node of the current (editor) node which is null during onblur().

I face this problem only in IE (8 and 9) but not in Chrome or Firefox. It also does not appear if I do not change the actual cell value.

My column definitions look like this:
{
editor: this._getWidgetFromControl, //provides a custom widget defined in the control object
editorArgs: control,
editOn: "dblclick",
autoSave: true,
control: control,
renderCell: dojo_lang.hitch(control, function (object, value, node, options) {...}),
canEdit: function () {..}
field: column.AttributeId,
label: column.Caption,
columnWidth: column.Width
}

@alcraciun
Copy link

Indeed this is a valid bug. Make a change to an editor in the grid and then try to change the value of another editor from the same column in the grid. The parent node is null. On FF the parent is the td-cell.

@ThomasEverding
Copy link
Author

I managed to find the td-cell node from the other side like this:
var gridId = column.grid.id;
var rowId = loadSelectedRowId();
var rowTableHtmlId = gridId + "-row-" + rowId;
var rowTable = dom.byId(rowTableHtmlId);
var columnId = column.id;
return rowTable.childNodes[0].childNodes[0].childNodes[columnId];

However this just suppresses the error messages in IE but does not make the editor widget reusable.

@kfranqueiro
Copy link
Member

I can't seem to reproduce this issue in test/editor.html. It looks like there are probably some details of your use-case that are left out, though (e.g. custom renderCell implementation, canEdit implementation, what types of widgets you're using for editors). Can you supply a reduced test case that we can reproduce the problem with to debug?

@ThomasEverding
Copy link
Author

Hi!

If you put the test-folder of release 0.3.8 into an environment with dgrid 0.3.0 and dojo 1.7.3 you get close to it (at least there is an error which sounds very similar).

Changing the dojo version is not possible because we rely on another library which is implemented in dojo. A test with dgrid 0.3.8 did not allow me to edit anything anymore in any browser I tested (may be a configuration thing).

On the editor.html choose component type text, editOn: double click and check autoSave and customRenderCell.

The editing works fine in chrome (v28.0) but in IE 9 you get this error when editing:
SCRIPT5007: Unable to get value of the property 'parentType': object is null or undefined
editor.html?editOn=, line 264 character 7
LOG: put called for ID: 1[object Object]

Actually I get this error without the editOn, autoSave and customRenderCell settings, too.

Thanks,
Thomas

p.s.: my canEdit function is rather simple and works as expected with different values for _editable and _editMode
canEdit: function () {
//disable editing for a column control by control.set("_editable", false)
if (this.control._editable == undefined) {
//if not set, editing is allowed
return this.control._editMode;
}
return this.control._editable && this.control._editMode;
}

@kfranqueiro
Copy link
Member

Even following the (admittedly obscure) process of attempting to test this with the latest editor.html test page against dgrid 0.3.0 and Dojo 1.7, I still can't reproduce the issue. The error message you're getting would suggest that the dgrid-datachange event handler is not being passed an event, which doesn't make sense.

So far I haven't seen a valid/reproducible issue here to debug. Please provide a reduced test case that can reproduce the issue against dgrid 0.3.10. Otherwise, there's not really much we can do if we can't find something broken to fix.

@kfranqueiro
Copy link
Member

Given no further information and lack of a reduced test case that can reproduce the issue, I'm going to close this.

In parting though, one more thought has occurred to me - since you said this is happening to you in IE9, can you ensure that your page/application does not have any links that don't navigate anywhere (such as links with javascript: hrefs) but also don't call preventDefault? This is known to do very weird things to IE9 and 10, like dispatching future events to the wrong handlers. We ran into that ourselves before in #379 (comment) and I've seen it trip up a couple of other folks as well.

@ThomasEverding
Copy link
Author

Hi!

Thanks for the hint, I will check it.

Regarding the further information, we might update some of our dependencies in the project soon, thus we would get a recent dgrid version, hopefully solving that problem. For now editing is disabled in IE…

Thanks,
Thomas

Given no further information and lack of a reduced test case that can reproduce the issue, I'm going to close this.

In parting though, one more thought has occurred to me - since you said this is happening to you in IE9, can you ensure that your page/application does not have any links that don't navigate anywhere (such as links with javascript: hrefs) but also don't call preventDefault? This is known to do very weird things to IE9 and 10, like dispatching future events to the wrong handlers. We ran into that ourselves before in #379 (comment)#379 (comment) and I've seen it trip up a couple of other folks as well.


Reply to this email directly or view it on GitHubhttps://github.com//issues/366#issuecomment-26141605.

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

No branches or pull requests

3 participants