should Kendo work in Smarty tpl files?
thanks,
Richard
3 Answers, 1 is accepted
Is it possible for you to provide more information regarding the problem? A source code and the error message would allow us to provide better assistance.
All the best,Petyo
the Telerik team
$(function() {
$("#grid").kendoGrid({
dataSource: {
transport: {
read: "data/employees.php",
update:
{
url: "data/employees.php",
type: "POST"
},
destroy:
{
url: "data/employeeDelete.php",
type: "DELETE"
},
create:
{
url: "data/employees.php",
type: "PUT"
}
},
error: function(e) {
alert(e.responseText);
},
schema: {
data: "data",
model: {
id: "EmployeeID",
fields: {
FirstName: { validation: { required: true} },
LastName: { validation: { required: true} }
}
}
}
},
columns: [{ field: "FirstName" }, { field: "LastName" }, {command: "destroy"}], <----------------------------- LINE 62
toolbar: [ "save", "cancel", "create"],
detailTemplate: kendo.template($("#template").html()),
detailInit: detailInit,
editable: true,
navigatable: true,
filterable: true,
scrollable: true
});
As you can see this is from an example in the blog section using php. Works great as a php file but in the tpl Smarty does not like it. What I did find is that to get around the problem use the {literal} {/literal} Smarty tags to ignore code within the section.
This seems like a general issue with Smarty and embedded JavaScript, described in their FAQ.
http://smarty.incutio.com/?page=SmartyFrequentlyAskedQuestions
Search for
Q: Is there a way to escape '{' and '}' in html?
(they do not have anchors for the FAQ section). All the best,
Petyo
the Telerik team