I've got a template that's displaying comments. There's no loop inside the template itself since I'm letting the datasource handle that. I have a situation now though, where I need to add content to the template on the 50th (for example) iteration of the template. If I had a loop, that would be easy, but I'm hoping to not have to refactor my existing template to manually include one.
JS:
function generateDiscussionView(container_id) { var template_html = $('#discussion_template').html(); var template = kendo.template(template_html, {useWithBlock: false}); discussion_datasource = new kendo.data.DataSource({ transport: { read: { url: "/DiscussionsController.cfc?method=getDiscussion", type: "get", dataType: "json", data: { ContainerID: container_id } } }, schema : { type: "json", data: "Comments" } }); discussion_datasource.bind("change", function() { var view = discussion_datasource.view(); var html = ""; html = kendo.render(function(data) { return template($.extend(data, {IsAdmin: is_admin, AURID: aur_id})); }, view); $('#discussion_display').html(html); }); discussion_datasource.read().then(function() { var data = discussion_datasource.data(); data = data[0]; global_container_id = container_id; }}Template:
<div id="discussion_display" class="list-items-content-area k-listview col-xs-12"></div><script id="discussion_template" type="text/x-kendo-template"> <div class="col-xs-12 disc-comment"> <div class="disc-nav"><img src="#= data.Photo #" onerror="imgError(this);" title="#= data.Poster #" /></div> <div class="overflow-hidden"> <div id="display_comment_#= data.CommentID #"> <p class="blue">#= data.Poster #</p> # var formatted_text = data.Text.replace(/(?:\r\n|\r|\n)/g, '<br />'); # <p>#= formatted_text #</p> <p class="small text-muted"> #= data.Created # # if (data.Editable) { # <a href="javascript:;" onclick="editComment(#= data.CommentID #);">Edit</a> # } # # if (data.Editable || data.IsAdmin) {# <a href="javascript:;" onclick="deleteComment(#= data.AURID #, #= data.CommentID #);">Delete</a> # } # </p> </div> # if (data.Editable) { # <div id="edit_comment_#= data.CommentID #" style="display: none;"> <textarea id="comment_#= data.CommentID#" class="form-control input-sm">#= data.Text #</textarea> <a id="add_comment_#= data.CommentID #" class="btn btn-default" data-commentid="#= data.CommentID #"> <i class="fa-icon-plus"></i> </a> <a href="javascript:;" onclick="cancelEdit(#= data.CommentID #);">Cancel</a> </div> # } # </div> </div></script>
The chart in the attached image was created using MS Chart.
Does Kendo UI Charts support this outcome?
If so, please provide example.
Thank you.
Hi,
I would like to use a grid that will data. The data cannot be edited/deleted once saved. But I want the ability to add a new row. The add new row can be via popup (preferable) or inline. Is this possible?
All examples I've seen have the Edit/Delete options on each row. When a new row is added these buttons are Save and Cancel...
If using inline editing I want no Edit/Delete buttons to be visible but when a row is added I need the Save Cancel.... better still if I have a popup for adding a new row then I would not need a column for the Edit/Delete.
Thanks.

Hi
I'm trying to use custom theme builder. http://demos.telerik.com/kendo-ui/themebuilder/ but it generates corrupted css now. It used to work correctly back in April.
.k-slider-horizontal .k-tick { background-image: url('url("http://kendo.cdn.telerik.com/2016.2.607/styles/Metro/sprite_2x.png")/slider-h.gif');}.k-slider-vertical .k-tick { background-image: url('url("http://kendo.cdn.telerik.com/2016.2.607/styles/Metro/sprite_2x.png")/slider-v.gif');}Could you please fix it? Also, is there anyway to specify local path?

I have a column which creates a dropdown list from a foreign key value.
I change the value in my application, the variable value changes but the drop down list does not update.
var dashboardTypeNames = [];
var menuNames = [];
columns: [
{ field: "DashboardTypeId", values: dashboardTypeNames, title: "Dashboard Type" },
{ field: "MenuId", values: menuNames, title: "Menu" },
],
On start I populate the dashboardTypeNames array with data using ajax the selected item value is then passed to another ajax which i want to populate the second dropdown I have an onchange function which gets the value of the selected item.
Anyhelp would be appreciated
Hi,
I'm using kendo with Angular, and looking for a way to format the tooltip with thousand coma seperator (what I have now, is not working)
and also have a number in the donut.
I know how to do it in JS but not in Angular..
this is my code (it's all on the html page) , can you please help me?
<div class="panel panel-default" style="width: 530px; margin-left:10px;float: left;">
<div class="panel-body">
<div
kendo-chart
k-title="{text: 'POR vs Burden', color: '#3d3c3c'}"
k-legend="{ position: 'bottom' }"
k-series-defaults="{ type: 'donut', startAngle: 270, labels: {
visible: true,
holeSize: 45,
background: 'transparent' }}"
k-series="[{
name: 'Value',
field: 'Value',
categoryField: 'Category',
labels: {
visible: false
},
holeSize: 70,
visibleInLegendField: 'visibleInLegend',
padding: 10
}]"
k-series-colors="['#b2473e', '#eb8a44']"
k-tooltip ="{visible: true, format:'{0:N0}'}"
k-data-source="burdenMoneydata"
style="height: 300px; width: 500px;">
</div>
</div>
</div>
I use the functionality of the multiselect to add or remove items, but I need a confirmation before an item will be deleted.
So I use the DataBound-Event to save the current values an everytime the Change-Event is triggered I compare the current values against the previous:
function onChange() {
var previous = this._savedValues;
var current = this.value();
if (current.length < previous.length) {
var diff = $(previous).not(current).get(0);
if (diff != null) {
var memberName = diff.substring(diff.indexOf('CN=') + 3, diff.indexOf(','));
var string = 'Delete' + memberName + '?';
if (confirm(string.replace('{0}', memberName))) {
console.log("confirmed"); // nothing more happens here
}
else {
//reset;
this.value(previous);
}
}
}
saveCurrent(this);
}
function saveCurrent(multi) {
multi._savedValues = multi.value().slice(0);
}
function onDataBound() {
saveCurrent(this);
}​
The problem is: This doesn't really work properly. If I add and remove some items, the multiselect deletes more items than I want to remove.
Hello,
A question about validation in kendo UI datasource.
I have a kendo grid and this grid has defined an editor template which is a custom directive 'tagSearch'. This custom directive has an input element into it with type text:
editor: function (container, options) {
var tagSelection = $('<div name="' + options.field + '"><tag-search></tag-search></div>');
tagSelection.appendTo(container);
}
In validation method I have the following code (into dataSource):
schema: {
model: {
id: "itemId",
fields: {
tag: {
type: "string",
validation: {
required: true,
tagvalidation: function (input) {
if (input.is("[type=text]")) {
if(...some validation...){
input.attr("data-tagvalidation-msg", "This tag is already added!");
return false;
}
return true;
}
}
}
}
}
}
But the validation message with the text "This tag is already added!" does not appear. So what could be the possible reason(s) for this issue
Thanks and Regards!