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

the plugin could not work in IE8 browser #15

Open
chinayuans opened this issue Oct 10, 2015 · 1 comment
Open

the plugin could not work in IE8 browser #15

chinayuans opened this issue Oct 10, 2015 · 1 comment

Comments

@chinayuans
Copy link

It reported: "对象不支持此属性或方法 dataTables-colResize-0.0.10.js, 行609 字符21" in chinese
the corresponding english: "the object could not support the property or method dataTables-colResize-0.0.10.js, Row 609 Character 21".

if you run it in IE8 mode of IE10 browser,you will find the root cause: this.s.init.exclude.indexOf
this.s.init.exclude是[] empty array. IE8 has not the "indexOf" method, but firefox,chrome,IE9,IE10 has the method. I used the way below to passby,but it could not still work in IE8 and reported a error from dataTable.js. It seems that sWidthOrig = NaNpx .

Array.prototype.indexOf = function(val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
}
return -1;
};

Please help me how to fix it in IE8 mode

@chinayuans
Copy link
Author

After I solved the array.IndexOf problem, then I changed the source code and solved the IE8 support problem.
In the 485 line :var minColumnWidth = Math.max(parseInt($(that.s.mouse.targetColumn.nTh).css('min-width')), 10);
I appended a line: if(!$.isNumeric(minColumnWidth)) minColumnWidth = 0;

In the 518 line: var minColumnNeighbourWidth = Math.max(parseInt($(that.s.mouse.neighbourColumn.nTh).css('min-width')), 10);

I appended a line: if(!$.isNumeric(minColumnWidth)) minColumnWidth = 0;

After I added the two lines ,It worked in IE8 mode.

The root cause of problem is :
the value of $(XXXX).css('min-width') in IE8 mode is "auto".

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

1 participant