Hi guys, in the latest Kendo UI release (2016.3.914) some of the k-icons were resized and the k-i-pdf icon now looks like it has been cut down / doesn't fit.
Latest update: http://demos.telerik.com/kendo-ui/styling/icons
Older version when it was still looking good: https://web.archive.org/web/20160317171312/http://demos.telerik.com/kendo-ui/styling/icons
I don't think this is intended so I thought I'd let you know, just in case this hasn't been reported already.
Hi All,
Im trying to pass parameter from combo box to action class. below is my cascading combo box. how can i get value of first combo box to action class to get list values to second combo box. i have created companyId(Long) setter and getter in action class but its always coming as value 1. please help me how to pass the value of first combo box to action class. below is my snipet.
<kendo:comboBox name="companyId" filter="contains" placeholder="Select company..." style="width: 50%;" suggest="true" dataTextField="unitName" dataValueField="id">
<kendo:dataSource data="${organizationUnitsList}"></kendo:dataSource>
</kendo:comboBox>
<label for="payGpName">Pay Group Name:</label>
<kendo:comboBox name="payGpName" filter="contains" placeholder="Select company..." style="width: 50%;" suggest="true" autoBind="false" cascadeFrom="companyId" dataTextField="payGpName" dataValueField="id">
<kendo:dataSource serverFiltering="false">
<kendo:dataSource-transport>
<kendo:dataSource-transport-read url="/reports/misreports/loadPayGroup" type="POST" contentType="application/json"/>
<kendo:dataSource-transport-parameterMap>
<script>
function parameterMap(options,type) {
return JSON.stringify(options);
}
</script>
</kendo:dataSource-transport-parameterMap>
</kendo:dataSource-transport>
</kendo:dataSource>
</kendo:comboBox>
I am trying to display a simple grid using data from MVCMusicStore controller action, but don't seem to get any results.
What am I doing wrong ?
The relevant page follows. The relevant project could not be attached due to size.
<div id="grid"></div>
<script>
$(function () {
$("#grid").kendoGrid({
height: 400,
columns: [
"Title",
{ field: "Price", format: "{0:c}", width: "150px" },
{ field: "AlbumArtUrl", width: "150px" },
{ command: "destroy", title: "Delete", width: "110px" }
],
editable: true, // enable editing
pageable: true,
sortable: true,
filterable: true,
dataSource: {
serverPaging: true,
serverFiltering: true,
serverSorting: true,
pageSize: 10,
schema: {
data: "Data",
total: "Total",
model: { // define the model of the data source. Required for validation and property types.
id: "AlbumID",
fields: {
AlbumID: { editable: false, nullable: true },
Title: { validation: { required: true } },
Price: { type: "number", validation: { required: true, min: 1 } },
AlbumArtUrl: { validation: { required: false } }
}
}
},
batch: true, // enable batch editing - changes will be saved when the user clicks the "Save changes" button
transport: {
read: {
url: "@Url.Action("Index", "StoreManager")", //specify the URL which should return the records.
contentType: "application/json",
dataType: "json",
type: "POST" //use HTTP POST request as by default GET is not allowed by ASP.NET MVC
},
parameterMap: function(data, operation) {
if (operation != "read") {
// post the products so the ASP.NET DefaultModelBinder will understand them:
// products[0].Name="name"
// products[0].ProductID =1
// products[1].Name="name"
// products[1].ProductID =1
var result = {};
for (var i = 0; i < data.models.length; i++) {
var album = data.models[i];
for (var member in product) {
result["albums[" + i + "]." + member] = album[member];
}
}
return result;
} else {
return JSON.stringify(data)
}
}
}
}
});
});
</script>
I have a problem grouping the schedule. In the sample http://demos.telerik.com/kendo-ui/scheduler/resources-grouping-horizontal it shows how to achieve this, but if I replace the datasource with an array, it doesn't work anymore. As soon as I remove the grouping attribute the events show up in the scheduler.
You can find the repro in this dojo: http://dojo.telerik.com/UCUle/7. This has two scheduler controls, which are exact copies of each other, only the group is different.
What am I doing wrong?
I have an Ajax bound grid with a simple textbox in the editor template. This works fine with simple value binding.
<input ... data-bind="value:valueproperty" ... />Now I want to add attribute binding as described here: http://docs.telerik.com/kendo-ui/framework/mvvm/bindings/attr
<input ... data-bind="attr:{data-someproperty:someproperty},value:valueproperty" ... />The template no longer works. It does not even show the value anymore so it looks like the binding fails.
I also tried some variations like:
<input ... data-bind="value:valueproperty, attr:{ 'data-someproperty':someproperty }" ... />Is this supposed to work at all?

Ok, Ive been going through the different demos/examples such as this one. Ive got the demo source code and using it to compare with what im doing.
http://demos.telerik.com/aspnet-mvc/grid/editing-custom
We have an existing application that a specific column in question is using an EditorTemplate that defines a dropdownlist and it works fine. However, it loads a list of items beforehand, so that when the grid renders, the list is available. This list is independent of the data for the rows or the viewmodel. Thats fine, but I need to load the dropdownlist after the grid and view have rendered and the user has provided some input via other controls. Using this input, rows are added to the grid - or rather rows are added to the underlying data, then the grid datasource is reloaded. So then this new row needs to have the column with the dropdown, be specific to the inputs the user has made. Each row will have the same dropdownlist for that column, but I cant know what the list will contain UNTIL after the grid and view have rendered and the user has provided input.
Imagine a customer order and its associated items. The user will have to provide some additional input before they can start adding items to the order. The sequence kinda goes like this:
- User chooses a few selections about the order, CustomerAccount, Shipper, etc...then they hit a button that creates the order
- Then the user starts adding items to the order (which render in the grid)
- The items in the grid include a column with the dropdownlist. Its this list that is dependent upon other data the user has provided and cant be known ahead of time.
The template approach seems to be fine - assuming you know what the list for the dropdown will be beforehand, but not if it must be determined AFTER the grid is rendered. So Im looking at these ideas, any suggestion would be appreciated:
(1) Use a datasource for the column with the dropdownlist, then when the user creates the order, now I can determine what the dropdownlist should contain, and it will be the same for each order item in the grid. I would need to update the column datasource somehow and have it refreshed.
(2) Continue to use the EditorTemplate, but each time I add an item to the grid, include a collection of items in the viewmodel, which I use to filter the list in the EditorTemplate
Suggestions?
I have an angularjs component that receives a json object as its input from another angular component. The ListView is initialized with the json object that is initially set as the input. However, when I change the json object from the main component, the data shown does not change even though the object itself has changed.
Below is my component code:
(function () { 'use strict'; var app = angular.module('myModule'); function myGroupCtrl() { var vm = this; vm.sortableOptions = { filter: '.k-listview div.group' }; vm.listOptions = { dataSource: new kendo.data.DataSource({ data: vm.groups }) }; vm.$onChanges = function (changes) { console.log(vm.groups); // new data console.log(vm.listOptions.dataSource.data()); // original data } } app.component('myGroupComponent', { controller: [ myGroupCtrl ], controllerAs: 'vm', templateUrl: 'app/myGroups.html', pageable: true, transclude: true, bindings: { groups: '<' } });})();
<kendo-sortable options="vm.sortableOptions"> <kendo-list-view id="groups" options="vm.listOptions"> <div class="group" k-template> <span class="h4"> {{dataItem.groupName}} </span> </div> </kendo-list-view></kendo-sortable>I thought there might be a way to rebind or refresh the dataSource, but everything that I have tried gives me an error. I have used k-rebind on the grid. Is there something similar for ListView? Thanks!
Auto complete for Document type works as expected when i add new file (Tool bar add file).
How do I achieve the same auto complete and validation if user clicks edit/Update? I am using ScaffoldColumn to make the Doc type editable when user clicks Edit in Kendo Grid??
@(Html.Kendo().Grid<FileDataModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.FileName);
columns.Bound(c => c.Title);
columns.Bound(c => c.SelectedDocType);
columns.Template(@<text></text>).Title("<b>Download</b>")
.ClientTemplate("<a href='" + Url.Action("Download", "Home", new { @id = "#=Id#" }) + "'>Download</a>")
.HtmlAttributes(new { style = "text-align: left;" });
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Title("<b>Action</b>");
}).Events(e => e.DataBound("onDataBound"))
.Scrollable(a=>a.Height("auto"))
.Selectable()
.Groupable()
.Sortable()
.Editable(config => config.Mode(GridEditMode.PopUp))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.ToolBar(toolBar => toolBar.Template("<a class='k-button k-button-icontext' onclick='addFilePopup()' href='#' id='addNewFile'></span>Add new file</a>"))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(false)
.PageSize(20)
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.Id).Editable(false);
model.Field(p => p.CreatedDate).Editable(false);
model.Field(p => p.DateSigned).Editable(false);
model.Field(p => p.DateSubmitted).Editable(false);
model.Field(p => p.DjjNumber).Editable(false);
model.Field(p => p.ScanDate).Editable(false);
model.Field(p => p.ScanUser).Editable(false);
})
.Read(read => read.Action("GetFiles", "Home", new { djjNumber = Model.DjjNumber }))
.Update(update => update.Action("EditingInline_Update", "Home"))
.Destroy(destroy => destroy.Action("EditingInline_Destroy", "Home"))
))
</div>
Kendo Autocomplete and Validation function.
$("#txtDocType").kendoAutoComplete({
dataSource: new kendo.data.DataSource({
type: "json", // specifies data protocol
pageSize: 3,//This is to set search limit
serverFiltering: true,
transport: {
read: '@Url.Action("GetDocumentTypes", "Home")',
parameterMap:function(){
return {filterKey:$("#txtDocType").data("kendoAutoComplete").value()};
}
},
}),
dataTextField:"Type",
filter: "contains",
minLength: 3,//This is to set minimum character length for autocomplete
});
});
function ValidateDocumentType(){
var isValidDocType=true;
$.ajax({
data:{documentType:$("#txtDocType").val()},
url:'@Url.Action("GetDocumentType", "Home")',
async: false,
success:function(data) {
if(data==false)
isValidDocType=false;
complete=true;
},
});
return isValidDocType;
}
I have a Kendo ListView, which I have selected set to "multiple". I also have a button on that page that will do data processing. Part of it's function is to get the selected items from that ListView and put them into some type of array. However I can't even accessthe bloody selected items from the ListView.
With Telerik's PATHETIC support for Angular I have to resort to jQuery, but even with that older code I still can't get a list of selected items from the ListView.
Obligatory code sections that proably won't make sense to anybody, but need to be included otherwise support will whine about not having code to review.
HTML:
<fieldset class="bsFilterSetGreyBk bsFullHeight"> <legend class="bsLegend">Available To Assign</legend> <div kendo-listview id="unAssignedListView" k-data-source="camu.mUnassigned" k-options="camu.klvOptions"></div> <div kendo-pager id="unAssignedPager" k-data-source="camu.mUnassigned"></div></fieldset>Angular Controller:
(function() { "use strict"; angular .module("controller.assignUser", ["ngAnimate", "ngMessages", "ngSanitize", "kendo.directives"]) .controller("ctrlAssignUser", [ "$window", "appSettings", "assignToUser", function ($window, appSettings, assignToUser) { var camu = this; camu.lstSelection = null; camu.selId = null; camu.auOptions = { optionLabel: "Click Here to choose user...", dataTextField: "user", dataValueField: "id", dataSource: { transport: { type: "jsonp", read: { url: appSettings.serverPath + "/api/assign/allusers/" } } } }; camu.klvOptions = { selectable: "multiple", template: "<div class='klvItems'>#= oldMeterNumber#</div>" } camu.addMtr = function() { var list = $("#unAssignedListView").data("kendoListView");//Resorting to jQueary because of... reasons! List is test variable that I can't get the selected data into. }; camu.changeAssUser = function () { if (camu.selId === "") { camu.selId = null; return; } camu.mUnassigned = new kendo.data.DataSource({ transport: { type: "jsonp", read: function(options) { assignToUser.getUnassigned.query( null, function(data) { options.success(data); }); } }, pageSize: camu.getListViewRows() }); camu.mAssignUser = new kendo.data.DataSource({ transport: { type: "jsonp", read: function (options) { assignToUser.getAssigned.query( { "userId": camu.selId }, function(data) { options.success(data); }); } }, pageSize: camu.getListViewRows() }); } camu.getListViewRows = function () { return Math.floor(($window.innerHeight - appSettings.windowChrome) / appSettings.rowHeightPx); }; camu.getPageHeight = function () { return { height: ($window.innerHeight - appSettings.navbarHeight) + "px" }; }; } ]);}());
