The first time a value is chosen from my dropdownlist it will display "object Object". After selecting an item a second time, it correctly displays. I've tracked the offending line down to binder.js:
isObservableObject = this._valueIsObservableObject
The first time through it is incorrectly (?) marked as an observable object so a complex object is set as the value.
Demo: http://dojo.telerik.com/oreve
Changing POA for an item that is not null works. Changing POA for the empty line shows object Object.
Hi,
I'm having trouble with the columns.locked attribute in kendo Grid. I have an angular grid that is grouped and uses a groupHeaderTemplate. In the template, I put the value through an angular expression (e.g. from id get the entity name). This all works fine, until I try to freeze a column (any of them), as soon as I set locked: true in any column in the grid, the angular expression is not evaluated.
See the grid in action: http://dojo.telerik.com/AsopA
Thanks in advance for any help.
A
Hi there,
I've got a number of grids working fine in my application, but the most recent one is giving me this error when I try and sort columns :-
"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet"
The page loads fine, but it happens when I try and sort a column. The grid has one fixed column (this sorts fine) and a number of dynamically generated columns (the sorts on these don't work). The dynamically generated columns are populated on the databound event in jQuery, hence populating the dynamic columns.
Here is my view code :-
@(Html.Kendo().Grid<TEAMSPortalV2.Models.PortalUserTrainingViewModel>()
.Name("grid")
.Columns(columns => {
columns.Bound(p => p.Details).Hidden();
columns.Bound(p => p.PortalUserID).Hidden();
foreach (TEAMSPortalV2.Models.MyColumnSettings col in Model.GridColumns)
{
if (col.PropertyName == "PortalUser")
{
columns.Bound("PortalUser").Title(col.Title);
}
else
{
columns.Bound("").Title(col.Title);
}
}
})
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => {
model.Id(p => p.PortalUserID);
foreach (TEAMSPortalV2.Models.MyColumnSettings col in Model.GridColumns)
{
if (!col.Editable) {
model.Field(col.PropertyName, col.ColType).Editable(false);
}
}
})
.Read(read => read.Action("GetPortalUserTrainings", "Training"))
)
.Events(events => events
.DataBound("onDataBound_portalUserTraining")
)
)
I tried modifying the controller to allow get - this allowed the request to be processed but instead it just drew the raw JSON of the response onto the screen rather than loading it into the grid.
Do you know how I can fix this? Or if there is a client-side way of sorting that doesn't have this issue, instead that would also be an acceptable solution too.
Thanks, Mark
HI in kendo grid page change event,If we keep ajax call,pagination first time only working.After that not at all working.Kindly provide the solution.Below is my code
var grid = $("#xmlgrid").data("kendoGrid");
var pager = grid.pager;
pager.bind('change', test_pagechange);
var pageSizeDropDownList = grid.wrapper.children(".k-grid-pager").find("select").data("kendoDropDownList");
pageSizeDropDownList.bind('change', test_pagesizechange);
function test_pagechange()
{
var curr_pageno = grid.dataSource.page();
var curr_pagesize = grid.dataSource.pageSize();
var localxmldetails = [];
if (curr_pageno == 1)
{
alert("page 1 is clicked");
localxmldetails = common_1stpage_dropdownchange();
bindingToDatasource(localxmldetails);
//alert(JSON.stringify(localxmldetails));
//mainxmldetails = localxmldetails;
//alert(JSON.stringify(mainxmldetails));
}
else
{
$.ajax({
type: "GET",
url: "/WC3/Resources/XML/ClientDetails.xml",
dataType: "xml",
async:false,
success: function (xml) {
var i = 0, ClientID, ClientName, AppDesc, WC3ClientKey, startval, endval;
startval = (curr_pageno - 1) * (curr_pagesize) + 1;
endval = (startval + curr_pagesize) - 1;
$(xml).find('Values').each(function () {
i++;
if (i >= startval && i <= endval) {
localxmldetails.push({ ClientID: $(this).find('ClientID').text(), ClientName: $(this).find('ClientName').text(), AppDesc: $(this).find('AppDesc').text(), WC3ClientKey: $(this).find('WC3ClientKey').text() })
}
else {
if (i < tp) {
return true;
}
else
return false;
}
});
//alert(JSON.stringify(xmldetailsLocal));
}
});
bindingToDatasource(localxmldetails);
}
}​
Hello,
I want to use one DataSource for different components like pie charts, bar charts and grids. So, if I set a filter on my UI all displayed widgets would refresh.
Example DataSource:
var dataSource = new kendo.data.DataSource({ data: [ {project: "Project A", budget: 700, task: "Task A"}, {project: "Project A", ​budget: 50, task: "Task ​B"}, {project: "Project ​B", ​budget: 250, task: "Task ​C"} ]});A pie char​t ​may display the total budget for each project. The chart would show the following data: Project A - 75%; Project B - 25%.
A bar chart may display the budget for each task. The data would be: Task A - 700, Task B - 50, Task C - 250.
And a grid may display the ​raw data without grouping ect.
My problem is that the DataSource seems not to fit this requirement, because a grouping and aggregation for the pie chart seems not to be possible. Is the DataSource designed to be shared among different modules? I want to avoid coding grouping, aggregation and filtering on my own, because the widget I am developing must provide much more components than pie chart, bar chart and grid with different filters and grouping the end user should attach/detach.
<div> <div id="UrlIndex" align="center" class="v-center"> <label for="icon-right"> <h4>Enter the URL</h4> </label> <span class="k-textbox k-space-right" style="width:70%" > <input class="k-textbox" type="text" id="icon-right" data-bind="value: url" /> <a href="#" class="k-icon k-i-search"></a> </span> </div> </div>(function () { var app; window.Books = kendo.observable({ url:"type ur URL", data: new kendo.data.DataSource({ transport: { read: this.get("url") }, schema: { data: "books" } }), test: function(){ } }); kendo.bind($("#UrlIndex"), window.Books); document.addEventListener("deviceready", function () { navigator.splashscreen.hide(); app = new kendo.mobile.Application(document.body,{layout: "main-layout"}); }, false); window.app = app;}());read: this.get("url")
I've seen a few samples on fetching data from Web API for MVVM with Kendo UI, but I see almost NO examples on how to post data properly to ASP.NET Web API. I saw an example where you guys said that you need to post an Array of items to Web API, but I'm not sure how old/accurate that is. Do you have any samples of how I can take an Edit form and Post Data to ASP.NET Web API. When I go to my Edit Page, I am using the Kendo.DataSource to retrieve the Model from the server, but I'm not sure how to post it back.(clientside JavaScript and what does the Web API expect from the client).
Thanks
my grid data come from angular http service, but I want to display the detail template for every record as a pop up and how to pass the id of the record to the detail template pop up, and by the way i don't show the id in the grid as a column, it's in the data but not shown.
<kendo-grid
k-options="voters.gridOptions"
k-ng-delay="voters.gridOptions">
</kendo-grid>
vm.gridOptions = {
dataSource: {
type: "json",
serverPaging: true,
serverSorting: true,
serverFiltering: true,
pageSize: 13,
transport: {
read:
function (e) {
query.page = e.data.page;
data.getResults(query).
then(function (data) {
e.success(data);
});
}
},
schema: {
data: function(e) {
return e.data.data.data;
},
total: function(e) {
return e.data.data.total;
}
}
},
columns: [
{ field: "full_name", title: "​Name" },
{ field: "birth_date", title: "​Birthdate" },
{ field: "profession", title: "Profession" },
],
pageable: true
};