Reputation: 253
I was hooking up my kendo list view to a php datasource using a forum post on Kendo UI.
I do not have a good background in JavaScript and found it hard to search with #/hash as keyword.
$("#listView").kendoListView({
dataSource: {
transport: {
read: "list_users.php",
},
schema: {
data: "data"
}
},
template:"<li>#:data.Name#</li>"
});
Upvotes: 0
Views: 4194
Reputation: 700412
To Javascript it doesn't have any special meaning at all. It's just a string.
When used in a Kendo template, the tag #: #
is replaced with a HTML encoded value. (The tag #= #
is replaced with a value without HTML encoding.)
Using the template directly in code, it would look like this:
var template = kendo.template("<li>#:data.Name#</li>");
var html = template({ data: { Name: 'Me!<o>' } });
The variable html
would now contain the string <li>Me!<o></li>
. Notice how the <
and >
from the name are HTML encoded.
Upvotes: 3