I have a Kendo grid Jquery component with field grouped and hidden. I would like to show a filter button based on this field. Could you help me ?
Thanks
Hi Guys,
I have JQuery, KendoUI ASPNET MVC 5 which has two pages Index and View Details Page each has a dedicated js file and want to return to the previous Grid page number when a button in View Details is clicked:
This is what I have tried so far:
I then attempted to fix the issue by trying to set the page number using the jquery.
ViewDetails.js
$(document).ready(function () {
Index.js
Results: Internal Server Error 500, when I click save or back button in the detailsPage
Another way that I tried was to use this function in the CustomerController's method:
greetings.
I drew a line chart where the x-axis is the time value and the y-axis is the number.
How can I highlight (or select) the place corresponding to the time axis of the line chart by clicking the time text link outside the chart?
thank you for answer.
I have a parent kendo grid which has a detail kendo grid with a custom template. The custom detail template includes a tab strip with two tabs. Each tab includes a single kendo grid. I am using the default create and edit kendo grid buttons with some custom text. The controls on the parent grid seem to be working normally. When I press "Add New Row" a kendo editor pops up (pop up editing enabled) and in the background I can see that a new row is created. However, on two detail grids which are contained within each of the two tabs it seems that the pop up create and edit functionality is not working correctly. A window is popped up and the editing/creating actually works, but the grid acts strangely - mainly when I press the cancel button to exit out of an "edit" event for a particular item in one of the detail grid rows.
I believe that I have included the appropriate amount of code to look into the issue.
Thanks for the help!
<div data-ng-controller="GridCtrl as gridCtrl"><script type="text/x-kendo-template" id="detail-grid-template">
<div class="detail-tab-strip">
<ul>
<li class="k-active">
Grid One
</li>
<li class="k-active">
Grid Two
</li>
</ul>
<div>
<div class="grid-one"></div>
</div>
<div>
<div class="grid-two"></div>
</div>
</div>
</script><script type="text/x-kendo-template" id="grid-one-editor">
<div>
<ul class="fieldlist">
<li>
<label for="GridOneID">ID</label>
<input type="text" class="k-input k-textbox full-width k-state-disabled" disabled="disabled" name="GridOneID" data-bind="value:GridOneID">
</li>
<li>
<label for="GridFieldOne">One</label>
<input type="text" class="k-input k-textbox full-width" name="GridFieldOne" data-bind="value:GridFieldOne">
</li>
<li>
<label for="GridFieldTwo">Two</label>
<input type="text" class="k-input k-textbox full-width" name="GridFieldTwo" data-bind="value:GridFieldTwo">
</li>
<li>
<label for="GridFieldThree">Three</label>
<input type="text" class="k-input k-textbox full-width" name="GridFieldThree" data-bind="value:GridFieldThree">
</li>
<li>
<label for="GridFieldFour">Four</label>
<select id="GridFieldFour" name="GridFieldFour" data-bind="value:GridFieldFour"></select>
</li>
<li>
<label for="GridFieldFive">Five</label>
<select id="GridFieldFive" name="GridFieldFive" data-bind="value:GridFieldFive"></select>
</li>
</ul>
</div>
</script></div>
function gridOneCreateOrEditEvent(e) {
var detailGridWrapper = this.wrapper,
mainGrid = $("#parentGrid").data("kendoGrid"),
$parentGridTr = $(detailGridWrapper).closest("tr").prev(),
parentData = mainGrid.dataItem($parentGridTr);
e.model.set("GridOneID", parentData.get("GridOneID"));
e.model.set("GridFieldFive", parentData.get("GridFieldFive"));
if (e.model.isNew()) {
e.container.kendoWindow("title", "Create Item");
}
else {
e.container.kendoWindow("title", "Edit Item");
}
$("#GridFieldFive").kendoDropDownList({
dataSource: vm.fieldFiveOptions,
change: function (c) {
var dropDownValue = $('#GridFieldFive').data("kendoDropDownList").value();
e.model.set("GridFieldFive", dropDownValue);
this.value(dropDownValue);
}
});
$("#GridFieldFour").kendoDropDownList({
dataSource: [
{ id: "A", name: "B" },
{ id: "B", name: "B" }
],
dataTextField: "name",
dataValueField: "id",
change: function (c) {
var dropDownValue = $("#GridFieldFour").data("kendoDropDownList").value();
e.model.set("GridFieldFour", dropDownValue);
this.value(dropDownValue);
}
});
if (e.model.get('GridFieldFour') === 'A')
$('#GridFieldFour').data("kendoDropDownList").value('A');
else {
$('#GridFieldFour').data("kendoDropDownList").value('B');
e.model.set("GridFieldFour", $('#GridFieldFour').data("kendoDropDownList").value());
}
var popupWindow = e.container.data("kendoWindow");
popupWindow.setOptions({ width: "600px" });
popupWindow.setOptions({ height: "700px" });
popupWindow.center();
}
function detailInit(e) {
var gridOneToolbar = [];
var gridOneCommands = [];
var detailRow = e.detailRow;
gridOneToolbar = [
{ name: "create", text: "Add New Entry" }
];
gridOneCommands = [
{ name: "edit", text: { edit: "Edit", update: "Save" } },
{ name: "Delete", iconClass: "k-icon k-i-close", click: showGridOneDeleteConfirmation }
];
detailRow.find(".detail-tab-strip").kendoTabStrip({
animation: {
open: { effects: "fadeIn" }
}
});
detailRow.find(".grid-one").kendoGrid({
dataSource: {
transport: {
create: createItem,
read: readItems,
update: updateItem,
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
batch: true,
pageSize: 10,
filter: [
{ field: "GridOneID", operator: "eq", value: e.data.GridOneID },
{ field: "GridFieldFive", operator: "eq", value: e.data.GridFieldFive }
],
schema: {
data: "Data",
total: "Data.length",
errors: handleGridErrors,
model: {
id: "GridOneID",
fields: {
GridOneID: {
editable: true,
defaultValue: e.data.GridOneID
},
GridFieldOne: {
editable: true
},
GridFieldTwo: {
editable: true
},
GridFieldThree: {
editable: true
},
GridFieldFour: {
editable: true
},
GridFieldFive: {
editable: true
},
RowStatus: {
editable: false, validation: { required: false }
},
RowMessage: {
editable: false, validation: { required: false }
}
}
}
}
},
scrollable: false,
sortable: true,
pageable: {
refresh: true
},
toolbar: gridOneToolbar,
columns: [
{ title: "", width: "40px", template: $('#grid-row-status-template').html() },
{ field: "GridOneID", title: "ID", width: "100px" },
{ field: "GridFieldOne", title: "One", width: "70px" },
{ field: "GridFieldTwo", title: "Two", width: "40px" },
{ field: "GridFieldThree", title: "Three", width: "40px" },
{ field: "GridFieldFour", title: "Four", width: "50px" },
{ field: "GridFieldFive", title: "Five", width: "60px" },
{
command: gridOneCommands,
title: " ", width: "180px"
}
],
edit: gridOneCreateOrEditEvent,
editable: {
mode: "popup",
template: kendo.template($("#grid-one-editor").html())
}
});
}
I am working on a page that has a table set to display: none and I want to have the Kendo UI Grid initialize its data set from this table. Unfortunately I am seeing that this does not work properly when the table has style=display: none as an attribute. In this situation I see the Grid's column headers render, but no rows are shown. Of course simply removing the display none style would fix the problem, but the table is several thousand rows and we have it hidden to increase page load performance.
Is there a way I can initialize the Kendo UI Grid from this hidden table, then show the grid afterwards?
Hello, dear colleagues.
I'd like to know, is there any approach to programmatically change grid's active page after calling dataSource.read transport method?
If I use dataSource.page(x), I'm having an infinite call chain.
I dont want to call dataSource read, my data is okay. I'd like to change grid's visual pager only, like "page 7 of 100".
Thank you.
I am resetting the grid's state like this:
const $grid = $gridRoot.find('.xifacts-simple-grid');
const grid = $grid.data('kendoGrid');
grid.dataSource.filter({});
grid.dataSource.sort({});
grid.dataSource.pageSize(5);
grid.clearSelection();
grid.dataSource.page(1);
All is good, the grid state is correctly reset (it goes to page 1) - but it still shows the old page that was selected.
Same for the Items/Page.
Here is a gif for the issue:
we have a field in which the source value is an array of objects, to edit it we use kendoMultiSelect, to show we just concat the values:
this.MultiSelectEmployeeClassesArrayToString = function (item) {
return item.EmployeeLicensingClasses
.map(function (employeeClass) { return employeeClass.Description; })
.join(', ');
},
is there a way to make filtering work as a contains for example & sort just the value we display (concatenating)?
Hi,
When I tried to filter the grid by pressing the buttons on top of the grid, the filtering does not appear to work.
I just dont know where I went wrong. I have done quite a few of them without issues, but on this one, i cannot see where the problem is. I have now triple check the code and I still can't see it!
Adding here a link to the dojo: https://dojo.telerik.com/@galedin/EXAZIJIx
Thanks,