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

Underscore bind function on columns view #11

Open
aasaidane opened this issue Mar 13, 2013 · 0 comments
Open

Underscore bind function on columns view #11

aasaidane opened this issue Mar 13, 2013 · 0 comments

Comments

@aasaidane
Copy link

Hi,
On a Backbone view, when i init my DataGrid and set the view with a function using an underscore bind like this:

this.statsGrid = new DataGrid({
                          .....
            columns: [{
                title: PageLocalizing.grid.columnsLabels.skill,
                property: 'level, processingType',
                view: _.bind(function(model) {
                    return this.getProfile(model.level, model.processingType);
                }, this ),
                sortable: true
                }
                }
            ]
            });

this don't works but if i use Jquery proxy method :

this.statsGrid = new DataGrid({
                          .....
            columns: [{
                title: PageLocalizing.grid.columnsLabels.skill,
                property: 'level, processingType',
                view: $.proxy(function(model) {
                    return this.getProfile(model.level, model.processingType);
                }, this ),
                sortable: true
                }
                }
            ]
            });

It's works

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