I'm looking to open a popup from a button on a grid row.
The purpose is not really to edit the row data but rather to take the row id (in this case company id) and load a modal with some dropdowns (for selecting/assigning users) and assign those to the company id passed into the modal view.
Is this kind of thing possible? If so, how might I go about starting to implement it?
Can I do it by opening a popup that contains a partialview?
Thanks.
Hi,
When I browse to a certain page in my project with a Kendo Grid inside, I'm having a little issue. The grid is shown not visually styled momentarily when the page is loaded. It's just a little "flash" of it, and then it's rendered appropriately. Any idea how to fix this?
I have an ASP.NET MVC application and it has a page that makes use of the KendoGrid:
$(function () {
$("#Grid").kendoGrid({
columns: [
{ "title": "Straat", "field": "Straat" },
{ "title": "Huisnummer", "field": "Huisnummer" },
{ "title": "Volledige Naam", "field": "VolledigeNaamKoperHuurder" },
{ "title": "Plaats", "field": "Plaats" },
{ "title": "Objectsoort", "field": "Objectsoort" },
{ "title": "Objectcode", "field": "Objectcode" }],
dataSource: {
transport: {
read: "/bouwobject/getbouwobjectenjson",
dataType: "json"
},
pageSize: 15
},
selectable: "row",
scrollable: false,
pageable: {
messages: {
display: "{0} - {1} van {2} items",
empty: "Geen items te tonen",
page: "Pagina",
of: "van {0}",
itemsPerPage: "items per pagina",
first: "Ga naar de eerste pagina",
previous: "Ga naar de laatste pagina",
next: "Ga naar de volgende pagina",
last: "Ga naar de laatste pagina",
refresh: "Verversen"
}
},
sortable: { mode: "single" },
filterable: {
messages: {
info: "Toon items met waarde", // sets the text on top of the filter menu
filter: "Filter", // sets the text for the "Filter" button
clear: "Opheffen", // sets the text for the "Clear" button
// when filtering boolean numbers
isTrue: "is waar", // sets the text for "isTrue" radio button
isFalse: "is onwaar", // sets the text for "isFalse" radio button
// changes the text of the "And" and "Or" of the filter menu
and: "En",
or: "Of"
},
operators: {
// filter menu for "string" type columns
string: {
eq: "Is gelijk aan",
neq: "Is ongelijk aan",
startswith: "Start met",
contains: "Bevat",
ncontains: "Bevat niet",
endswith: "Eindigt met"
},
// filter menu for "number" type columns
number: {
eq: "Is gelijk aan",
neq: "Is ongelijk aan",
gte: "Is groter dan of gelijk aan",
gt: "Is groter dan",
lte: "Is kleiner of gelijk aan",
lt: "Is kleiner dan"
},
// filter menu for "date" type columns
date: {
eq: "Is gelijk aan",
neq: "Is ongelijk aan",
gte: "Is na of op",
gt: "Is na",
lte: "Is op of voor",
lt: "Is voor"
},
// filter menu for foreign key values
enums: {
eq: "Is gelijk aan",
neq: "Is ongelijk aan"
}
}
},
groupable: {
messages: {
empty: " Verplaats de titel van een kolom hier naar toe om te groeperen op die kolom"
}
}
});
});
This grid is on a page where there is a button where the user can navigate to a new page. This page has a form, and once filled in and submitted stays on that page. The user then can click a button to go back to the page with the grid. Now, on my machine this grid is updated with some of the values the user just filled in the form. When deployed at the client, this does not happen. The use has to refresh the page with the grid for the values to come up.
What is happening?
I need to make a Custom Toolbar button mesh in with the other 2 buttons.
(See attachment and code)
.ToolBar(tools =>
{
tools.Custom().Text("Print this Page").Name("PrintPage").Url("#").HtmlAttributes(new { @class = "export-img" });}
)
I have tried to apply CSS just can't get the ".Custom()" to take effect.
Suggestions?
Thanks
Hi,
I've create a task sheduler. Read and create are working fine ( data are created in database with a generated Guid: oid) but when I try to update my task I've got an Internal error 500 visible on my Chrome developper console. In effect No data are sent !
Did I forgot something?
Please see my code:
@(Html.Kendo().Scheduler<Elearning.ViewModels.TasksViewModel>()
.Name(
"scheduler"
)
.Date(DateTime.Today)
.StartTime(
new
DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 6, 0, 0))
.DateHeaderTemplate(
"<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd dd/M')#</span>"
)
.Height(480)
.Views(views =>
{
views.DayView();
views.WorkWeekView(workWeekView => workWeekView.Selected(
true
));
views.WeekView();
views.MonthView();
//views.AgendaView();
//views.TimelineView();
})
.Resources(resource =>
{
resource.Add(m => m.CoursID)
.Title(
"Leçon"
)
.DataTextField(
"Text"
)
.DataValueField(
"Value"
)
.DataColorField(
"Group.Name"
)
.BindTo(Model.Lessons);
})
.DataSource(d => d
.Model(m => {
m.Id(f => f.oid);
m.Field(f => f.oid).DefaultValue(
new
Guid());
m.Field(f => f.Title);
m.Field(f => f.Start);
m.Field(f => f.End);
m.Field(f => f.StartTimezone);
m.Field(f => f.EndTimezone);
m.Field(f => f.IsAllDay);
m.Field(f => f.Description);
m.Field(f => f.RecurrenceRule);
m.Field(f => f.RecurrenceException);
m.Field(f => f.RecurrenceID);
m.Field(f => f.UtilisateurID).DefaultValue(UserContext.CurrentUser.oid);
m.Field(f => f.CoursID);
})
.Read(
"Read"
,
"Tasks"
)
.Create(
"Create"
,
"Tasks"
)
.Update(
"Update"
,
"Tasks"
)
.Destroy(
"Destroy"
,
"Tasks"
)
)
)
I have an MVC app, with a Grid in it. It pulls it's data via ajax from an MVC Controller that reaches out to a restful API to retrieve it's data. All along the "All" option has worked fine, but the number of records has been steadily increasing. Now it's a little over 5000 records, and the "All" option no longer shows all of them.
In the Controller, after pulling the data from the restful API, the data is indeed all there before returning it to the grid via a DataSourceRequest. In the browser console I see an error stating it's a 500 server error.
Is there a limit on how many records the grid can deal with? 5000 surely seems like a small number...
Here is my controller code, which is feeding the grid:
[HttpPost]
[ActionName(
"DocumentSearchResults"
)]
public
ActionResult DocumentSearchResults([DataSourceRequest] DataSourceRequest request,
bool
unMatchedOnly,
string
docketNumber,
string
employeeId,
string
ssnNumber,
string
lastName,
string
firstName,
string
caseID,
string
garnishType,
string
clientId,
string
miscNotes,
string
startDate,
string
endDate)
{
GarnishmentDocumentSearch docSearch =
new
GarnishmentDocumentSearch()
{
UnMatchedOnly = unMatchedOnly,
DocketNumber = docketNumber,
EmployeeId = employeeId,
SSNNumber = ssnNumber,
LastName = lastName,
FirstName = firstName,
CaseId = caseID,
GarnishType = garnishType,
ClientId = clientId,
StartDate = !
string
.IsNullOrEmpty(startDate) ? DateTime.Parse(startDate) : DateTime.MinValue,
EndDate = !
string
.IsNullOrEmpty(endDate) ? DateTime.Parse(endDate) : DateTime.MinValue,
MiscNotes = miscNotes
};
List<UploadedDocument> response = WebApiHelper.CallPostAPI<List<UploadedDocument>, GarnishmentDocumentSearch>($
"{_garnishAPI}DocumentSearch"
, docSearch);
return
Json(response.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
As I said, the response object contains all the records no problem, and again I reiterate, it worked fine until the record count hit 5000. Several days ago, when it was still about 2900 records, the "All" option worked as expected.
I need a way to run javascript code after a sort or a filter has been done. Unusually, the datasource is in the view model - not an ajax call to the server.
Here is my grid:
@(Html.Kendo().Grid(Model.TrunkGridData)
.Name("TrunkSummaryGrid")
.Columns(columns =>
{
columns.Bound(c => c.DepotNumber).Title("Depot").Sortable(true);
columns.Bound(c => c.TrunkName).Title("Trunk").Sortable(true);
columns.Bound(c => c.TipType).Title("Tip / Load").Sortable(true);
columns.Bound(c => c.ArrivalTimeExpected).Title("Booked Arrival").Sortable(true);
columns.Bound(c => c.ArrivalTimeActual).Title("Actual Arrival").Sortable(true);
columns.Bound(c => c.DepartureTimeExpected).Title("Booked Departure").Sortable(true);
columns.Bound(c => c.DepartureTimeActual).Title("Actual Departure").Sortable(true);
})
.Filterable()
.Sortable()
.Scrollable()
.Selectable()
.HtmlAttributes(new { style = "height:700px;" })
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName("TrunkSummary.xlsx")
.Filterable(true)
.ProxyURL(Url.Action("Excel_Export_Save", "Grid"))
)
.DataSource(dataSource => dataSource
.Custom()
.ServerFiltering(false)
.ServerSorting(false)
.Schema(schema => schema
.Model(model =>
{
model.Id("TrunkRouteID");
model.Field("DepotNumber", typeof(string));
model.Field("TrunkName", typeof(string));
model.Field("TipType", typeof(string));
model.Field("ArrivalTimeExpected", typeof(string));
model.Field("ArrivalTimeActual", typeof(string));
model.Field("DepartureTimeExpected", typeof(string));
model.Field("DepartureTimeActual", typeof(string));
model.Field("IsLate", typeof(bool));
model.Field("IsThirtyMinutesLate", typeof(bool));
model.Field("ArrivalMinsLate", typeof(double));
model.Field("DepartureMinsLate", typeof(double));
model.Field("TrunkRouteID", typeof(int));
})
)
)
)