This is a migrated thread and some comments may be shown as answers.

Grid Row Custom Row Command Bind To an Function

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anil
Top achievements
Rank 1
Anil asked on 10 Jun 2013, 09:43 PM
I would like to bind a custom command from a kend grid (currently using mvvm) to function.

{ "command": { "text":"hello world", "click":"helloWorld" } }

On click the function does not get called. I get a query error instead, can you please advise.

1 Answer, 1 is accepted

Sort by
0
Accepted
Anil
Top achievements
Rank 1
answered on 10 Jun 2013, 11:06 PM
Figured out the solution out for this one, 
{ "command": { "text":"hello world", "click":helloWorld } }
The click method should not be in quotes,  kendo ui it applies the call operator "()" to the string and it fails at runtime.
It also works for a function as part of a view model, however it does not intrinsically call the view model function even after a kendo bind
{ "command": { "text":"hello world", "click":viewModel.helloWorld } }
Tags
Grid
Asked by
Anil
Top achievements
Rank 1
Answers by
Anil
Top achievements
Rank 1
Share this question
or