SlickGrid: stylesheet variable is undefined in Chrome
Got this error when tried to use forceFitColumns option in Chrome (v 14.0.835.202 m)
Apparently, appending <style> to <head> does not add the CSSStyleSheet object to document.styleSheets, and findCssRule(selector) fails because stylesheet variable is undefined.
Checked, it works in Opera and IE, so looks like a Chrome bug, didn’t find a good solution…
About this issue
- Original URL
- State: closed
- Created 13 years ago
- Comments: 50 (10 by maintainers)
Commits related to this issue
- Fix issue #223 by lazy-getting cell CSS rules. — committed to mleibman/SlickGrid by mleibman 12 years ago
- - removed the broken container-level focusin/focusout handling - now 'slickgrid-container'is a class that is always attached to the outermost DIV that contains the entire grid. This is used by the st... — committed to GerHobbelt/SlickGrid by GerHobbelt 10 years ago
- Changed function "createCssRules". regarding issue #223 @Maheshkumar-Kakade posted a solution that worked for us — committed to GustavSt/SlickGrid by GustavSt 10 years ago
- Implement fix for https://github.com/mleibman/SlickGrid/issues/223 — committed to smithkl42/SlickGrid by smithkl42 10 years ago
- clean up my act regarding proper grid initialization in Chrome: we ourselves let the app (userland) code take care of this business via using the `options.explicitInitialization` option and calling fi... — committed to GerHobbelt/SlickGrid by GerHobbelt 10 years ago
- attempt at fixing infamous 'Cannot find stylesheet' error in slickgrid. solution from https://github.com/mleibman/SlickGrid/issues/223 by Maheshkumar-Kakade as it appears to have the lowest touch and ... — committed to littlebee/SlickGrid by deleted user 9 years ago
- Attempt to resolve issue #387 Fix suggested by Maheshkumar-Kakade in https://github.com/mleibman/SlickGrid/issues/223 — committed to NPellet/visualizer by stropitek 9 years ago
- Add workaround from mleibman/SlickGrid#223 — committed to rubenv/SlickGrid by rubenv 9 years ago
- XP-2234 Add and verify that all descendants of FormInputEl correctly update dirty flag - Fixed SlickGrid's Cannot find stylesheet exception according to https://github.com/mleibman/SlickGrid/issues/2... — committed to enonic/xp by pmi 9 years ago
- XP-2234 Add and verify that all descendants of FormInputEl correctly update dirty flag - Fixed SlickGrid's Cannot find stylesheet exception according to https://github.com/mleibman/SlickGrid/issues/2... — committed to enonic/xp by pmi 9 years ago
- XP-2234 Add and verify that all descendants of FormInputEl correctly update dirty flag - Fixed SlickGrid's Cannot find stylesheet exception according to https://github.com/mleibman/SlickGrid/issues/2... — committed to enonic/xp by pmi 9 years ago
- create CSS rules programmatically instead of waiting for document.styleSheets to be populated. References https://github.com/mleibman/SlickGrid/issues/223#issuecomment-34407932 — committed to Veoci-Backup/SlickGrid by dandormont 8 years ago
- Add fix from Maheshkumar-Kakade for upstream SlickGrid issue #223 See https://github.com/mleibman/SlickGrid/issues/223#issuecomment-34407932 — committed to shoop/slickgrid-es6 by StijnHoopVDL 7 years ago
- Add fix from Maheshkumar-Kakade for upstream SlickGrid issue #223 See https://github.com/mleibman/SlickGrid/issues/223#issuecomment-34407932 — committed to shoop/slickgrid-es6 by StijnHoopVDL 7 years ago
- Add fix from Maheshkumar-Kakade for upstream SlickGrid issue #223 See https://github.com/mleibman/SlickGrid/issues/223#issuecomment-34407932 — committed to shoop/slickgrid-es6 by StijnHoopVDL 7 years ago
- Merge pull request #223 from 6pac/feature/group-totals-expose-grid feat: closes #222 expose grid in groupitemmetadataprovider — committed to vlsi/SlickGrid by 6pac 6 years ago
While dynamically creating style and style rule via text node, Google Chrome does not add stylesheet to document.styleSheets immediately. As dynamic stylesheet doesn’t exist getColumnCssRules() throws “Cannot find stylesheet.” exception. To fix this I have added css rule vai JS. This works on (chrome,firefox and IE)
Modify createCssRules() and add new function addCSSRule. addCSSRule force browser to create stylesheet under document.styleSheets.