$(
"#attachments"
).parents(
".t-upload"
).find(
".t-upload-files"
).remove()
Hello,
I am having a strange problem and cannot find any solution. I have a simple grip in popup:
<script>
function createDepositsTable() {
$("#depositsTable").kendoGrid({
height: 200,
scrollable: true,
dataSource: {
data: depositdata
},
resizable: true,
columns: [
{
field: "TransactionDate",
title: "Date",
type: "date",
headerAttributes: { style: "vertical-align: top;white-space: normal" },
format: "{0:MM-dd-yyyy}",
attributes: { class: "text-left" }
}, {
field: "Value",
title: "Amount",
headerAttributes: { style: "vertical-align: top;white-space: normal" },
format: "{0:c2}",
attributes: { class: "text-right" }
}],
});
console.log(depositdata);
var grid = $("#depositsTable").data("kendoGrid");
grid.bind();
}
Another dropdown selects an account and gets the data. Initially 9 records populated in datasource for grid and they displayed fine. If I select another account, 2 records populated and I can see them in console.log(depositdata); => 2 records, but the grid will display the old ones plus new = 11. Any other selection will just add new records to the end of the grid. I did try re-bind: grid.bind();
re-create:
$(document).ready(createDepositsTable);
$(document).bind("kendo:skinChange", createDepositsTable);
refresh, but nothing helped. Do you have any idea what could be done here?
Thanks.
Hi,
I'm trying to export a grid with a big data to PDF file but I'm constantly having problems with it In Chrome,
it's fail to download a file (Failed - Network error). When i try to download it with Opera or Firefox it downloads without a problem.
What is causing this behavior?
In my web app I created a class DataSourceResult
/// <summary>
/// DataSource result
/// </summary>
public
class
DataSourceResult
{
/// <summary>
/// Extra data
/// </summary>
public
object
ExtraData {
get
;
set
; }
/// <summary>
/// Data
/// </summary>
public
IEnumerable Data {
get
;
set
; }
/// <summary>
/// Errors
/// </summary>
public
object
Errors {
get
;
set
; }
/// <summary>
/// Total records
/// </summary>
public
int
Total {
get
;
set
; }
}
and in my controller
[HttpPost]
[AdminAntiForgery]
public
IActionResult PortList(DataSourceRequest command)
{
if
(!_permissionService.Authorize(StandardPermissionProvider.ManageVendors))
return
AccessDeniedKendoGridJson();
var ports = _worldPortIndexService.GetAllPorts(pageIndex: command.Page - 1, pageSize: command.PageSize);
var model = ports.Select(p =>
{
var store = _worldPortIndexService.GetPortById(p.Id);
return
new
PortMainModel
{
Id = p.Id,
PortName = p.PortName,
UNLOCODE = p.UNLOCODE,
Country = p.Country,
LatDec = p.LatDec,
LonDec = p.LonDec
};
}).ToList();
return
Json(
new
DataSourceResult
{
Data = model,
Total = ports.TotalCount
});
}
and my view script is
$(document).ready(
function
() {
$(
"#ports-grid"
).kendoGrid({
dataSource: {
type:
"json"
,
transport: {
read: {
url:
"@Html.Raw(Url.Action("
PortList
", "
PortGuideAdmin
"))"
,
type:
"POST"
,
dataType:
"json"
,
data: addAntiForgeryToken
},
destroy: {
url:
"@Html.Raw(Url.Action("
Delete
", "
PortGuideAdmin
"))"
,
type:
"POST"
,
dataType:
"json"
,
data: addAntiForgeryToken
}
},
schema: {
data:
"Data"
,
total:
"Total"
,
errors:
"Errors"
,
model: {
id:
"Id"
}
},
requestEnd:
function
(e) {
if
(e.type ==
"update"
) {
this
.read();
}
},
error:
function
(e) {
display_kendoui_grid_error(e);
// Cancel the changes
this
.cancelChanges();
},
pageSize: @(defaultGridPageSize),
serverPaging:
true
,
serverFiltering:
true
,
serverSorting:
true
},
pageable: {
refresh:
true
,
pageSizes: [@(gridPageSizes)],
@await Html.PartialAsync(
"_GridPagerMessages"
)
},
editable: {
confirmation:
"@T("
Admin.Common.DeleteConfirmation
")"
,
mode:
"inline"
},
scrollable:
false
,
columns: [{
field:
"Id"
,
headerTemplate:
"<input id='mastercheckbox' type='checkbox'/>"
,
headerAttributes: { style:
"text-align:center"
},
attributes: { style:
"text-align:center"
},
template:
"<input type='checkbox' value='#=Id#' class='checkboxGroups'/>"
,
width: 50
}, {
field:
"PortName"
,
width: 200,
title:
"Port Name"
}, {
field:
"UNLOCODE"
,
width: 100,
title:
"UNLO CODE"
},{
field:
"Country"
,
width: 200,
title:
"Country"
}, {
field:
"LatDec"
,
width: 100,
title:
"Latitude"
},{
field:
"LonDec"
,
width: 100,
title:
"Longitude"
}, {
field:
"Id"
,
title:
"@T("
Admin.Common.Edit
")"
,
width: 100,
headerAttributes: { style:
"text-align:center"
},
attributes: { style:
"text-align:center"
},
template:
'<a class="btn btn-default" href="Edit/#=Id#"><i class="fa fa-pencil"></i>@T("Admin.Common.Edit")</a>'
}]
});
});
when I turn filterable and sortable true filter and sorting is not updating my grid.Grid views list fine. all other functions are working except filtering and sorting.
Hi,
We recently upgraded from 2016 library to latest one. One of the widgets we are using is Chart and we have situation where we display yearly data spread through the weeks.
In previous version we simply had categoryAxis configuration set to
baseUnit: "weeks",
labels: {
step: 1,
dateFormats: {
weeks: "cw"
}
},
majorGridLines: {
visible: true
},
axisCrossingValues: [0, 54]
However, after upgrading to the new version, instead of displaying week numbers (1 to 52) it simply displays cw text.
I tried all possible things i could think of, but couldn't make it display week numbers, so I would appreciate a little help. :)
Thanks
var
myDataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
'http://localhost/MyODataService.asmx'
,
dataType:
'jsonp'
,
data: {
$select:
'RecordID, FirstName, LastName'
}
},
parameterMap:
function
(data, operation) {
if
(operation ==
'read'
) {
return
kendo.data.transports[
'odata'
].parameterMap(data, operation);
}
else
{
return
JSON.stringify(data.models);
}
}
},
type:
'odata'
,
pageSize: 200,
serverPaging:
true
,
serverSorting:
true
,
batch:
true
});
jQueryGrid.kendoGrid({
dataSource: myDataSource
height: 530,
scrollable: {
virtual:
true
},
reorderable:
true
,
resizable:
true
,
sortable:
true
,
columns: [
'RecordID'
,
'FirstName'
,
'LastName'
],
selectable:
'row'
});
myGrid.data(
'kendoGrid'
).dataSource.read();
myGrid.data(
'kendoGrid'
).refresh();
myGrid.data(
'kendoGrid'
).select(
'tr:eq(0)'
);
Hello
I have noticed an issue when moving from 2017.3.1026 to 2018.1.221 which causes a dropdown with a 'valueTemplate' to be drawn oddly as if it is trying to draw blank line above the value.
I enclose a couple of images of how it looks now and how it looked before.
I have looked at the docs and I cannot see if I need to change the format of the 'valueTemplate'
Any suggestions would be appreciated.
Thanks
James
here is some sample code:
<input id="dropdownlist" />
<script>
$("#dropdownlist").kendoDropDownList({
dataSource: [
{ id: 1, name: "Apples", txtColor: "black", bkgColor: "lightblue" },
{ id: 2, name: "Oranges", txtColor: "black", bkgColor: "slateblue" },
{ id: 3, name: "Pears", txtColor: "black", bkgColor: "lightgreen" }
],
dataTextField: "name",
dataValueField: "id",
template: '<div style="color: #= txtColor #; background-color: #= bkgColor #;">#= name #</div>',
valueTemplate: '<div style="color: #= txtColor #; background-color: #= bkgColor #;">#= name #</div>'
});
</script>
grid.dataSource.data(collTemp);
Hello.
I want to create grid where in some of the columns would be a datepicker just to select the time.
Here is a data which I recive (1 record sample) : {shopID: 16, scheduleDay: "2000-01-01T00:00:00", shopWorkingHourID: 1,…}
Here is my model schema :
schema: {
model: {
fields: {
shopID: "shopID",
scheduleDay: "scheduleDay",
workStartHour: "workStartHour",
workEndHour: "workEndHour",
}
}
}
Here is my column configuration :
columns: [
{
field: "shopID"
},
{
field: "scheduleDay",
format: "{0:yyyy/MM/dd}"
},
{
field: "workStartHour",
editor: function (container, options) {
console.log('here');
var input = $("<input/>");
input.attr("workStartHour", options.model.workStartHour);
input.appendTo(container);
input.kendoTimePicker({});
},
format:"{0:HH:mm}",
}]
Time is displayed correctly but I cannot pick the time, even picker isn't shown.
Some crucial information
* I've tried convert data I receive to new Date
* I've included scripts corectly
* I don't get any errors
I'll take any advice how to make this work.