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

kendo MVVM DropdownList Editor

3 Answers 169 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Neeraj
Top achievements
Rank 1
Veteran
Neeraj asked on 30 May 2018, 11:07 AM
Hello,
            I have  inside Promise function that makes the accessibility  I have a grid and column has which is Kendo DropDownList. 
I wanted functionality like in this http://jsbin.com/judagiroyi/edit?html,js,output  but since my is not global cannot directly write editor code as below in grid:


data-columns='[{"field": "SettlementType", template: kendo.template($("\\#ImportPNRSettlementTypeTemplate").html()),
              editor: viewModel.ImportPNRSettlementTypeEditor, title: "Settlement Type"
             }
]'

it shows some error pointing to kendo script which is not correct and which means ImportPNRSettlementTypeEditor is not accessible. if i declare JavaScript with  function ImportPNRSettlementTypeEditor    and make  editor: ImportPNRSettlementTypeEditor  it works. What to do if want editor in my model? 

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 01 Jun 2018, 08:38 AM
Hello Neeraj,

The Grid column editor template is evaluated in the global scope, so the function that you specify needs to be accessible through the global scope. I assume you do not want to expose your view model in the global scope and in such case it is not possible to declare the editor function in the view model.

Regards,
Tsvetina
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Neeraj
Top achievements
Rank 1
Veteran
answered on 04 Jun 2018, 04:28 AM
any alternatives in h case?
0
Tsvetina
Telerik team
answered on 05 Jun 2018, 03:00 PM
Hi Neeraj,

Not in an MVVM Grid. If using jQuery initialization, you can directly pass a function from the current scope, where the Grid initialization takes place, to the editor property (Dojo).


Regards,
Tsvetina
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DropDownList
Asked by
Neeraj
Top achievements
Rank 1
Veteran
Answers by
Tsvetina
Telerik team
Neeraj
Top achievements
Rank 1
Veteran
Share this question
or