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

MVVM Grid with Popup Template

3 Answers 308 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 18 Jun 2012, 04:14 PM
Hello.

I've created a grid and bound to an observable via MVVM, all went fine.

Now I'm trying to implement a custom popup template for the grid with the following:

<div
    data-role="grid"
    data-sortable="true"
    data-editable='{"mode": "popup", "template": "kendo.template($(/"#popup/").html())"}'
    data-columns='[{"field": "CustomerAddressType_Name", "title": "Type", "width": "70px"}, {"field": "CustomerAddress_Line1", "title": "Line 1"}, {"field": "CustomerAddress_Postcode", "title": "Postcode"}, {"field": "Country_Name", "title": "Country"}, {"command": [ "edit", "destroy" ], "filterable": false, "sortable": false, "width:": "240px"}]'
    data-bind="source: addresses()"></div>

I believe the line:

 data-editable='{"mode": "popup", "template": "kendo.template($(/"#popup/").html())"}' co

is incorrect though as I'm getting an invalid template error.

Would some kindly point me in the right direction please?

Many thanks.

3 Answers, 1 is accepted

Sort by
0
Brad Sumner
Top achievements
Rank 1
answered on 03 Jul 2012, 02:51 PM
Richard,

I'm running into the same issue as your are and was wondering if you found a solution.  I've tried various forms of escaping and can't get it to work either.  I'm getting an error or in the latest form below the text  kendo.template($("#editTemplate").html()) appears in the popup window. 

'{ "mode": "popup", "template": "kendo.template($(\"\\#editTemplate\").html())" }'

Thanks,
Brad
0
Kerry
Top achievements
Rank 1
answered on 13 May 2013, 08:52 PM
Just to speed up anybody else with this error, leave off the quotes around kendo.template.

data-editable='{"mode": "popup", "template": kendo.template($("#editTemplate").html()) }' 
0
jj
Top achievements
Rank 1
answered on 24 Mar 2015, 11:27 AM
Hi, is this working? I am getting error still
Tags
MVVM
Asked by
Richard
Top achievements
Rank 1
Answers by
Brad Sumner
Top achievements
Rank 1
Kerry
Top achievements
Rank 1
jj
Top achievements
Rank 1
Share this question
or