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

Defining cellRenderer functions in Fields Causes Maximum call stack size exceeded #5

Closed
jonavila opened this issue Feb 13, 2015 · 1 comment
Labels

Comments

@jonavila
Copy link

Looking through the source code of jsgrid.js, I noticed the following conditional checks inside of the _createCell function of the Grid

            if($.isFunction(field.cellRenderer)) {
                $result = $(this.cellRenderer(fieldValue, item));
            } else {
                $result = $("<td>").append(field.itemTemplate ? field.itemTemplate(fieldValue, item) : fieldValue);
            }

When the first condition is met, "this" points to the Grid object and not to the Field object which is where the cellRenderer function is defined. I believe this is what's causing the error. When I change the line to:
$result = $(field.cellRenderer(fieldValue, item));
everything works well.

@tabalinas tabalinas added the bug label Feb 13, 2015
tabalinas added a commit that referenced this issue Feb 13, 2015
@tabalinas
Copy link
Owner

Thank you for pointing this out. Fixed. Will be included in the next patch.

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

No branches or pull requests

2 participants