Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Knockout kendo grid template binding

Tags:

knockout.js

I want to use template binding like below but its not working for me, can you please suggest whats wrong?

<div id="gridClientsOutside" data-bind="kendoGrid: { data: FilteredClients, columns: [ { field: 'ClientName', title : 'Client Name' }, { field: 'ClientCode', title: 'Client Code', **template:'<input type='button' value ='#= ClientCode #'></input>**' } ], scrollable: false, sortable: true, pageable: false }">
</div>
like image 603
Venkat Avatar asked Oct 07 '22 13:10

Venkat


1 Answers

You would want to escape your quotes like:

<div id="gridClientsOutside" data-bind="kendoGrid: { data: FilteredClients, columns: [ { field: 'ClientName', title : 'Client Name' }, { field: 'ClientCode', title: 'Client Code', template: '<input type=\'button\' value=\'#= ClientCode #\' />' } ], scrollable: false, sortable: true, pageable: false }">
</div>

Sample here: http://jsfiddle.net/rniemeyer/zeQMT/

like image 193
RP Niemeyer Avatar answered Oct 13 '22 10:10

RP Niemeyer