Hi
I very often use the filtering event for e.g. AutoComplete controls. The event lets me manipulate the filter before the DataSource sends the request.
When the user input consist of two words, I can configure the filter to perform a search in two different fields etc.
Now I would like to add some sort of pre-filter to a kendo grid. I know well how to create complex filters and I can add the pre-filter data separately to the data sent by the DataSource. But I would like to be able to directly manipulate the filter used by the Grid/DataSource just as I do it with AutoCompletes.
Is there a way to 'inject' filter rules directly into the filter used by the grid just as it is possible with other controls?
Regards
Alex
I have data stored for the Treelist as an adjacency list in the database. I call the data using JSON and then, per the instructions in the documentation, I use the schema.parse function to then convert a nested JSON to a flat array.
The first value comes out and displays in the tree. When I click to get the child, nothing shows. The object structure is the same as the parent.
Here is the code:
JSON OF PARENT
{"id": 26, "tgtWeight": 0.0, "currWeight": 0.0, "hasChildnode": true, "ext_model_id": 8, "parent": null, "SSM": {"id": 8, "securitySelectionModelName": "ssm8", "userCreatedModel": "[{\"classificationName\":\"ssm8\",\"id\":8,\"hasChildNode\":true,\"child\":[{\"classificationName\":\"MBS\",\"id\":14,\"hasChildNode\":true,\"child\":[{\"classificationName\":\"Common Stock\",\"id\":15,\"hasChildNode\":false}]}]}]", "classificationNames": []}, "classificationNameNode": null}JSON OF CHILD
[{"id": 27, "tgtWeight": 0.0, "currWeight": 0.0, "hasChildnode": true, "ext_model_id": 14, "parent": {"id": 26, "tgtWeight": 0.0, "currWeight": 0.0, "hasChildnode": true, "ext_model_id": 8, "parent": null, "SSM": 8, "classificationNameNode": null}, "SSM": {"id": 8, "securitySelectionModelName": "ssm8", "userCreatedModel": "[{\"classificationName\":\"ssm8\",\"id\":8,\"hasChildNode\":true,\"child\":[{\"classificationName\":\"MBS\",\"id\":14,\"hasChildNode\":true,\"child\":[{\"classificationName\":\"Common Stock\",\"id\":15,\"hasChildNode\":false}]}]}]", "classificationNames": []}, "classificationNameNode": {"id": 14, "classificationLevel": 2, "classificationName": "MBS", "hasChildNode": false, "parent": 2}}]These get converted into a JAVASCRIPT OBJECT in the schema.parse.
JAVASCRIPT
01.$(document).ready(function () {02. var id = {{ id }};03. 04. var dataSource = new kendo.data.TreeListDataSource({05. transport: {06. read: {07. url: "../getModelTargetWeights?SSM_id="+id,08. dataType: "json"09. }10. },11. schema: {12. parse: function(response) {13. NodeArray=[];14. if (response.length == undefined) {15. 16. var node = {17. id: response.id,18. currWeight: response.currWeight,19. tgtWeight: response.tgtWeight,20. hasChildren: response.hasChildnode,21. parentId: response.parent,22. ext_model_id: response.ext_model_id,23. securitySelectionModelName: response.SSM.securitySelectionModelName,24. classificationNameNode: response.classificationNameNode25. };26. NodeArray.push(node);27. } else {28. for (var i=0; i < response.length; i++){29. var node = {30. id: response[i].id,31. currWeight: response[i].currWeight,32. tgtWeight: response[i].tgtWeight,33. hasChildren: response[i].hasChildnode,34. parentId: response[i].parent.ext_model_id,35. ext_model_id: response[i].ext_model_id,36. securitySelectionModelName: response[i].SSM.securitySelectionModelName,37. classificationNameNode: response[i].classificationNameNode.classificationName38. }39. NodeArray.push(node);40. }41. }42. 43. return NodeArray;44. },45. model: {46. id: "id",47. parentId: "parentId",48. fields: {49. parentId: { field: "parentId", nullable: true },50. securitySelectionModelName: "securitySelectionModelName",51. classificationNameNode: "classificationNameNode",52. tgtWeight: { field: "tgtWeight", nullable: true },53. hasChildren: { type: "boolean", field: "hasChildren" }54. }55. }56. }57. });58. 59. $("#treeList").kendoTreeList({60. dataSource: dataSource,61. editable: true,62. height: 540,63. columns: [64. { field: "securitySelectionModelName", title: "Model Name" },65. { field: "classificationNameNode", title: "Classification" },66. { field: "tgtWeight", title: "Target" }67. ],68. });69. dataSource.read();70. });71.</script>

Hello,
I'm trying to export a grid with foreign keys to excel. The grid values for the foreign keys are blank in the export. How do I make them appear?
Here is a dojo example.
Thanks.
Hi,
I try to achieve feature, where the user can select multiply rows in the grid (e.g. to open a 'multi-edit' dialog), and additionally there should be displayed details for the currently selected item (generally - the currently clicked one).
I'm trying the following snippet:
var tmpCurrent = e.sender.current(); // this seems to be set to some object
currentItem: kendo.data.ObservableObject;
currentItem = e.sender.dataItem(tmpCurrent); //this is always null
Another question - is there any way to get the class object the datasource was initially filled with from the ObservableObject?
In a datasource's transport read function I prepare the array of DictionaryKey objects and then pass as the success result:
options.success(this.dictionaryKeys);
Is there any option to get those object when reading the select() items? This will be much easier to write in TypeScript having an instance of known class instead of using get("prop_name") construction in the code...
Best regards
Marcin Danek
Hi There;
My code is as follows:
public class Kisi
{
[Display(Name="date1")]
public DateTime date1{ get; set; }
[Display(Name = "date2")]
public DateTime date2 { get; set; }
[Display(Name = "date3")]
public DateTime date3{ get; set; }
}
here is my view:
//most parts ommited for brevity
@model LojmanMVC.Domain.Kisi
@{
ViewBag.Title = "KisiOlustur2";
}
<h2>KisiOlustur2</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<!-- date1-->
<div>
<div class="editor-label">
<label>date1? </label>
</div>
<div class="editor-field">
@(Html.Kendo().DatePickerFor(m=>m.date1)
.Name("dtpickerMemuriyetBaslama")
.Min(new DateTime(1900, 1, 1))
.Max(new DateTime(2099, 12, 31))
.Value(DateTime.Today)
)
<br />
<!-- Html.ValidationMessageFor(model => model.MemuriyetBaslamaTarihi)-->
</div>
</div>
<div id="tey" style="display:none">
<div class="editor-label">
@Html.LabelFor(model => model.date2)
</div>
<div class="editor-field">
@(Html.Kendo().DatePickerFor(m=>m.date2)
.Name("dtAskerlikBaslama")
.Min(new DateTime(1900, 1, 1))
.Max(new DateTime(2099, 12, 31))
.Value(DateTime.Today)
)
@Html.ValidationMessageFor(model => model.AskerlikBaslangicTarihi)
</div>
</div>
<div id="hey" style="display:none">
<div class="editor-label">
@Html.LabelFor(model => model.date3)
</div>
<div class="editor-field">
@(Html.Kendo().DatePickerFor(m=>m.AskerlikBitisTarihi)
.Name("dtAskerlikBitis")
.Min(new DateTime(1900, 1, 1))
.Max(new DateTime(2099, 12, 31))
.Value(DateTime.Today)
)
</div>
</div>
Here is my _Layout.cshtml:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
<link href="/Content/Site.css" type="text/css" rel="stylesheet" />
<link href="/Scripts/jquery-ui.css" rel="stylesheet" />
<link href="~/Scripts/MenuStyle.css" rel="stylesheet" />
<link href="~/Scripts/jquery-ui.css" rel="stylesheet" />
<link href="@Url.Content("~/Content/kendo/2016.1.112/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2016.1.112/kendo.mobile.all.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2016.1.112/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2016.1.112/kendo.default.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2016.1.112/kendo.dataviz.default.min.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/kendo/2016.1.112/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-1.11.4.min.js"></script>
<script src="~/Scripts/jquery-ui.js"></script>
<script src="~/Scripts/jquery-ui.min.js"></script>
<script src="@Url.Content("~/Scripts/kendo/2016.1.112/jszip.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2016.1.112/kendo.all.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2016.1.112/kendo.aspnetmvc.min.js")"></script>
<script src="~/Scripts/kendo/2016.1.112/cultures/kendo.culture.tr-TR.min.js"></script>
<script>
kendo.culture("tr-TR");
</script>
</head>
<body>
<div id="header">
<div class="title">Lojman Bilgi Sistemi</div>
</div>
<div id="categories">
@{ Html.RenderAction("Menu", "Nav"); }
</div>
<div id="content">
@RenderBody()
</div>
</body>
</html>
The problem is that model's date1 date2 and date3 is null even though I pick date. How can I solve it?
Thanks in advance.
I have a grid which has columns created dynamically based on different engagements. now i need to export the grid as-is from an active page to excel. I am new to kendo UI and any help on how to this would be much appreciated.
Thanks.
Hi,
Please find the attached image,
1- i need to format shared tool tip title as dd/MMM/yyyy , knowing that i was able to create a template and it works for the tool-tip but not for the title.
2-the legend in the attached image represents the Series lines example 2016-* And PY-* is 2016 & PY(2015), i need to pro grammatically group them in one legend as * so when i click * it will visible OR invisible the two Series 2016-* And PY-*
Thanks for helping.
Regards,
We have a scheduler nested inside a div element. This div element can change its width.
When the container div changes its width, the schedule elements no longer align correctly on the calendar.
See this Plunker snippet for a demonstration of the problem: http://plnkr.co/edit/UlHFtkvHHtIStnHEnOP9?p=preview
After you've pressed the "Toggle Left Bar" button, you see that "Alex's Birthday" now straddles two days.
Is there are workaround to this problem?
Our code base is arranged so that the parent control knows nothing about the child controls hosted within it.
I have created a schedule and allowed for the user to filter the people (grouping) that are shown on the schedule. When I retrieve the filtered people (I only have one, I call:
j$("#scheduler").data("kendoScheduler").resources[0].dataSource.read();After, I read and refresh my schedule, first retrieving data and assigning to an array, and then calling:
scheduler.dataSource.read();The first time that I do this, I get an error from executing that line saying "Cannot read property '_continuousEvents' of undefined". However, if I filter the people anytime after that, I don't get an error and everything completes successfully. Any ideas?