Hi,
I'd like to use the PivotGrid control in a scenario where there may be several layers of grouping in the Rows.
At the moment on the demos page I can see that when you expand a group (eg "All Products"), the expanded items are not directly below the All Products heading but off to the right. This very quickly eats up horizontal room.
Is it possible to instead nest the expanded items almost directly below the heading (maybe only slightly to the right), like you'd expect in a tree view?
I'm including a screenshot of what it looks like and what I'd like to be able to do.
Cheers,
Ilya
<
form
action
=
"/"
id
=
"testForm"
>
<
input
type
=
"hidden"
name
=
"__EVENTTARGET"
id
=
"__EVENTTARGET"
value
=
""
/>
<
input
type
=
"hidden"
name
=
"__EVENTARGUMENT"
id
=
"__EVENTARGUMENT"
value
=
""
/>
<
input
type
=
"text"
id
=
"testInput"
value
=
""
>
<
a
id
=
"testValidate"
href
=
"javascript:;"
>Validate</
a
>
</
form
>
var
validatable = $(
"#testForm"
).kendoValidator({
rules: {
testRule1:
function
(input) {
// Only "Tom" will be a valid value for the FirstName input
return
input.is(
"[name=firstname]"
) && input.val() ===
"Tom"
;
},
testRule2:
function
(input) {
return
$.trim(input.val()) !==
""
;
}
},
messages: {
testRule1:
"Your name must be Test"
,
testRule2:
"Your name must be Foo"
}
}).data(
"kendoValidator"
);
$(
"#testValidate"
).click(
function
() {
if
(validatable.validate()) {
alert(
'passed'
);
}
});
Hi,
I've been researching the scheduler and can't seem to see if I can get the scheduler to format Data like the below
Person Monday 25th Tuesday 26th Wednesday 27th Thursday 28th etc
Jamie
Chris
Fred
Steve
Basically I want day slots for each person that I can schedule tasks for. Only one box is required for the task (we can combine multiple tasks into one if necessary) However if its possible to add multiple tasks to the one box that is even better (for drag and dropping tasks between people / days)
Any assistance greatly appreciated or advice on another control that might be better suited.
Stefan
I have a grid that I want to populate from data returned from an ajax request.
The data is returned as part of the Ajax response, but is not displayed in the grid.
My code is:-
$.ajax({
type:
"POST"
,
async:
true
,
contentType:
"application/json;charset=utf-8"
,
url:
"@Url.Content("
~/Dynamic/CompareTables
")"
,
data:
'{"tab1":"'
+ t1 +
'","tab2":"'
+ t2 +
'","link1":"'
+ l1 +
'","link2":"'
+ l2 +
'","CompDesc":"'
+ desc +
'"}'
,
dataType:
"json"
,
success:
function
(data) {
if
(data.Success ==
true
) {
alert(data.Message);
//Create grid from data
var
fMatches =
new
kendo.data.DataSource({ data: data.FieldMatches });
fMatches.read();
$(
"#fieldCompGrid"
).kendoGrid({
dataSource: {
data: fMatches,
schema: {
model: {
fields: {
FieldName: { type:
"string"
},
FieldTypeMatch: { type:
"boolean"
},
MatchFound: { type:
"boolean"
},
MaxLengthMatch: { type:
"boolean"
},
PrecisionMatch: { type:
"boolean"
},
OutputHeader: { type:
"string"
},
Output: { type:
"string"
},
CanBeCompared: { type:
"boolean"
}
}
}
},
pageSize: 20
},
height: 550,
scrollable:
true
,
sortable:
true
,
filterable:
true
,
pageable: {
input:
true
,
numeric:
false
},
columns: [
"FieldName"
,
{ field:
"FieldTypeMatch"
, title:
"Type Match"
},
{ field:
"MaxLengthMatch"
, title:
"Max Length Match"
, width:
"130px"
},
{ field:
"CanBeCompared"
, title:
"Can Be Compared"
}
]
});
//show div
$(
'#resultsDiv'
).show();
//$("#Grid").data("kendoGrid").dataSource.read();
$(
'#compBtn'
).show();
$(
'#imgWait'
).hide();
}
else
{
$(
'#imgWait'
).hide();
alert(data.Error);
$(
'#compBtn'
).show();
}
}
,
error:
function
() {
$(
'#imgWait'
).hide();
alert(
"An error has occurred."
);
$(
'#compBtn'
).show();
}
});
How can I get this working?
Thanks
Hi,
I'm having a problem with a dropdownlist not showing the item that is returned when datasource is refreshed. It can be tested to see what I mean in the following dojo sample. Can anyone point me in the right direction on how to get the dropdownlist to show the returned item when the "Click me" button is returned.
<!DOCTYPE html>
<
html
>
<
head
>
<
meta
charset
=
"utf-8"
>
<
title
>Untitled</
title
>
<
link
rel
=
"stylesheet"
href
=
"https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.common.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.rtl.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.default.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.mobile.all.min.css"
>
<
script
src
=
"https://code.jquery.com/jquery-1.12.3.min.js"
></
script
>
<
script
src
=
"https://kendo.cdn.telerik.com/2019.3.1023/js/angular.min.js"
></
script
>
<
script
src
=
"https://kendo.cdn.telerik.com/2019.3.1023/js/jszip.min.js"
></
script
>
<
script
src
=
"https://kendo.cdn.telerik.com/2019.3.1023/js/kendo.all.min.js"
></
script
></
head
>
<
body
>
<
div
id
=
"registrationForm"
>
<
input
id
=
"vessel"
class
=
"grid-class"
data-value-primitive
=
"true"
data-role
=
"dropdownlist"
data-auto-bind
=
"true"
data-text-field
=
"dn"
data-value-field
=
"id"
data-bind
=
"source: Vessels, value: VesselId"
data-filter
=
"contains"
/>
<
button
data-role
=
"button"
data-icon
=
"edit"
data-bind
=
"events: { click: onClick }"
style
=
"width: 180px"
>Click me</
button
>
</
div
>
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
viewModel = kendo.observable({
VesselId: 36844,
onClick: function() {
viewModel.set('VesselId', 32638);
viewModel.Vessels.read();
},
Vessels: new kendo.data.DataSource({
transport: {
read: {
dataType: "json",
type: 'GET'
},
parameterMap: function (data, type) {
if (type === 'read') {
var value = '';
if (data.filter !== undefined) {
var filter = data.filter.filters[0];
if (filter !== undefined) {
value = data.filter.filters[0].value;
}
}
return { text: value, id: viewModel.get('VesselId') };
}
}
},
serverFiltering: true
}),
});
kendo.bind($("#registrationForm"), viewModel);
});
</
script
>
</
body
>
</
html
>
Hi
I have implemented the new Drawer component:
$("#drawer").kendoDrawer({
template: tooltemplate,
mode: "push",
mini: true,
itemClick: function (e) {
e.sender.drawerContainer.find("#drawer-content > div").addClass("hidden");
e.sender.drawerContainer.find("#drawer-content").find("#" + e.item.find(".k-drawer-id").text()).removeClass("hidden");
var spanItemText = e.item.find(".k-item-text").html();
$('#titleSpan').html(spanItemText);
},
position: 'left',
minHeight: 800,
swipeToOpen: false
});
All is great. The Drawer component functions perfectly. Whenever it is used it always defaults to the top (first) drawer. My users now want the ability to specify which drawer is selected by default. I've implemented a my settings page where the user can specify which drawer they prefer as their default. This value (which is the spanItemText value in my code above) is stored in a cookie. How do I select this drawer each time the component is used. Or is there a better way of doing this? I'm trying to programmatically click the drawer icon but I'm not having much luck at the moment.
Thanks.
Hope this is the right forum, there isn't one for "pager".
We have a datasource that is associated with a pager object - directly, not via a grid.
This worked fine in 2019/1 but when we updated to 2019/3 it stopped working - rather than having a list of page numbers left-to-right along the bottom, we just have a single page number with a dropdown menu associated with it.
This dojo illustrates:
https://dojo.telerik.com/IYolIKoL
Adding the setting
responsive: false
fixes the issue.
Is this an intended change in behaviour? I can't see it documented anywhere, and we don't get the same thing happening if the pager is associated with a grid rather than a datastore.
So I am working in ASP.NET MVC using a Kendo Grid and I am having trouble with the grid not reloading after calling read. There isn't an error in the console and the grid just goes blank. At first I thought it was because it was editable but then i removed that and it still has issues.
Grid:
01.
@(Html.Kendo().Grid<Common.Warehouse.ViewModels.WareHouseAssetViewModels.AssetTransferSKUViewModel>()
02.
.Name(
"AssetTransferGrid"
)
03.
.HtmlAttributes(
new
{ @style =
"height:100%"
})
04.
.Columns(columns =>
05.
{
06.
columns.Bound(m => m.SKUTitle).Title(
"SKU"
);
07.
columns.Bound(m => m.SerialNumber).Title(
"Serial Number"
).Media(
"sm"
);
08.
columns.Bound(m => m.QtyShipped).Title(
"Quantity"
).Media(
"sm"
);
09.
columns.Bound(m => m.ValueEach).Title(
"Value Each"
);
10.
columns.Command(command => command.Destroy());
11.
})
12.
.ToolBar(toolbar =>
13.
{
14.
toolbar.Custom().Text(
"Ship Transfer"
).HtmlAttributes(
new
{ @id =
"Ship"
});
15.
toolbar.Save();
16.
toolbar.Excel();
17.
toolbar.Pdf();
18.
})
19.
.Pdf(pdf => pdf
20.
.AllPages()
21.
.AvoidLinks()
22.
.RepeatHeaders()
23.
.RepeatHeaders()
24.
.FileName(
"Transfer_Ship"
)
25.
.PaperSize(
"8.5in"
,
"11in"
)
26.
.Scale(0.8)
27.
.Margin(
"3pt"
,
"3pt"
,
"3pt"
,
"3pt"
))
28.
.Excel(excel => excel
29.
.FileName(
"Transfer_Ship"
)
30.
.AllPages(
true
))
31.
.Editable(editable => editable.Mode(GridEditMode.InCell))
32.
.DataSource(datasource => datasource
33.
.Ajax()
34.
.Events(e => e.Error(
"error_handler"
))
35.
.PageSize(40)
36.
.ServerOperation(
true
)
37.
.Model(model =>
38.
{
39.
model.Id(m => m.Id);
40.
})
41.
.Sort(sort => sort.Add(m => m.SKUTitle).Ascending())
42.
.Read(read =>
43.
{
44.
read.Type(HttpVerbs.Post);
45.
read.Action(
"ReadShippedTransferSKUs_Async"
,
"AssetManager"
,
new
{ assetTransferId = Model.Id } );
46.
})
47.
.Update(update => update.Action(
"UpdateTransferSKU"
,
"AssetManager"
))
48.
.Destroy(destroy => destroy.Action(
"DeleteTransferSKU"
,
"AssetManager"
))
49.
)
50.
.Scrollable(sc => sc
51.
.Height(500)
52.
.Endless(
true
)
53.
.Enabled(
true
)
54.
)
55.
.Sortable()
56.
.Filterable(ftb => ftb
57.
.Mode(GridFilterMode.Menu)
58.
.Extra(
false
)
59.
.Operators(op => op
60.
.ForString(str => str
61.
.Clear().Contains(
"Contains"
).StartsWith(
"Begins With"
).EndsWith(
"Ends With"
)
62.
)
63.
)
64.
)
65.
.Selectable(select => select
66.
.Mode(GridSelectionMode.Single)
67.
.Type(GridSelectionType.Row)
68.
)
69.
.Mobile(MobileMode.Auto)
70.
.NoRecords(n => n.TemplateId(
"noRecords"
))
71.
)
72.
73.
@Html.Partial(
"_TemplateNoRecords"
)
Server Code:
01.
public
async Task<ActionResult> ReadShippedTransferSKUs_Async([DataSourceRequest]DataSourceRequest request, Guid assetTransferId)
02.
{
03.
string
entityId = getEntityID();
04.
DataSourceResult result = await IWarehouse.GetAssetTransferSKUsByTransferId(assetTransferId, entityId)
05.
.Select(s =>
new
WAVM.AssetTransferSKUViewModel
06.
{
07.
Id = s.ID,
08.
SKUTitle = s.SKU.Title,
09.
SerialNumber = s.SKUItem !=
null
? s.SKUItem.SerialNumber :
string
.Empty,
10.
QtyShipped = s.QtyShipped,
11.
QtyReceived = s.QtyShipped,
12.
ValueEach = s.ValueEach
13.
})
14.
.ToDataSourceResultAsync(request);
15.
16.
return
Json(result, JsonRequestBehavior.AllowGet);
17.
}
Javascript Callback:
01.
function
skuAddSucces(data) {
02.
var
x = data[
"Success"
];
03.
var
y = data[
"SuccessMsg"
];
04.
var
z = data[
"Type"
];
05.
alertShow(x, z, y);
06.
if
(x) {
07.
var
grid = $(
"#AssetTransferGrid"
).kendoGrid().data(
"kendoGrid"
);
08.
grid.dataSource.read();
09.
}
10.
}