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

Default formatter context broken since 0.3.7 #748

Closed
mbretter opened this issue Oct 14, 2013 · 1 comment
Closed

Default formatter context broken since 0.3.7 #748

mbretter opened this issue Oct 14, 2013 · 1 comment

Comments

@mbretter
Copy link

When accessing "this", inside a formatter until 0.3.6 it was the GridColumn, starting from 0.3.7 it is window.
This patch re-installs the old behavior:

--- Grid.js.orig    2013-10-14 12:10:44.774374695 +0200
+++ Grid.js 2013-10-14 12:10:47.702374735 +0200
@@ -505,7 +505,7 @@
                formatterScope = this.grid.formatterScope;

            td.innerHTML = typeof formatter === "string" && formatterScope ?
-               formatterScope[formatter](data, object) : formatter(data, object);
+               formatterScope[formatter](data, object) : this.formatter(data, object);
        }else if(data != null){
            td.appendChild(document.createTextNode(data)); 
        }
@ghost ghost closed this as completed in 80252e9 Oct 14, 2013
@kfranqueiro
Copy link
Member

Argh, kicking myself for missing this. Thanks for pointing it out.

This issue was closed.
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

2 participants