Kendo MVVM switch to Kendo MVVM grid cell

1 Answer 72 Views
Grid MVVM Switch
Chiran
Top achievements
Rank 1
Iron
Iron
Chiran asked on 12 Aug 2021, 12:22 PM

Hi, 

I'm trying to add kendo mvvm switch to kendo mvvm grid cell,

Please give me a good example to do this on both on mvvm.

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 17 Aug 2021, 07:24 AM

Hi, Chiran,

You can use the columns.template configuration to add a custom element to a certain column.

// Template
      <script id="switchTemplate" type="x-kendo/template">
      	 <input data-role="switch"
               data-bind="enabled: isEnabled" />
      </script>

// ... Column configuration
data-columns="[
                                 { 'field': 'ProductName', 'width': 270 },
                                 { 'field': 'UnitPrice' },
                                 { 'title': 'Switch Column', template: $('#switchTemplate').html() }
                              ]"

Dojo Example:

https://dojo.telerik.com/@gdenchev/InomIDIR 

Best Regards,
Georgi Denchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid MVVM Switch
Asked by
Chiran
Top achievements
Rank 1
Iron
Iron
Answers by
Georgi Denchev
Telerik team
Share this question
or