I have the following grid. However, I was given the requirement that we shouldn't have the search exposed full time. We should only display it when we have more than 1 page worth of data. How do I accomplish this?
@using Portal.Configuration
@using Portal.Models
@{
ViewData["Title"] = "Customers";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<
h2
>Customers</
h2
>
<
p
>
<
a
asp-action
=
"Create"
>Create New</
a
>
</
p
>
<
div
class
=
"row"
>
<
div
class
=
"col-xs-18 col-md-12"
>
@(Html.Kendo().Grid<
Customer
>()
.Name("grid")
.Columns(columns =>
{
columns.Command(command => command
.Custom("Detail")
.Click("goDetail"))
.Width(Glossary.ButtonWidth);
columns.Bound(p => p.Name)
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
.ShowOperators(false)
.SuggestionOperator(FilterType.Contains)));
columns.Bound(p => p.ProfileId)
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
.ShowOperators(false)
.SuggestionOperator(FilterType.Contains)));
columns.Bound(p => p.DatabaseStatus.Name).Title("Database Status")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
.ShowOperators(false)
.SuggestionOperator(FilterType.Contains)));
columns.Bound(p => p.AddTimestamp).Format("{0:MM/dd/yyyy}");
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("IndexJson", "Customers"))
)
)
<
script
type
=
"text/javascript"
>
function goDetail(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
window.location.href = '@Url.Action("Details", "Customers")/' + dataItem.Id;
}
function error_handler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors,
function (key, value) {
if ('errors' in value) {
$.each(value.errors,
function () {
message += this + "\n";
});
}
});
alert(message);
}
}
</
script
>
</
div
>
</
div
>
Hi,
I have a treeview and I want to bind hierarchical data.
Country
State
Offices in State
I want to make call to the controller and get the data based on the node that is being expanded. To get the right data I want send the parameter of the currently selected node (Id, level) so that I can get the appropriate data to expand.
@(Html.Kendo().TreeView()
.Name("exampleTreeView")
.LoadOnDemand(true)
.Checkboxes(checkboxes => checkboxes
.Name("checkbox")
.CheckChildren(true)
)
.Events(events => events
.Check("onCheck")
)
.DataTextField("Name")
.DataSource(dataSource => dataSource
.Model(model=>model.Id("Value").HasChildren("HasChildren"))
.Read(read => read.Action("GetData", "MyController"))
)
)
Right now I can get the first set of data from getdata method and bind it. want to expand a nde which will call the same action method with some additional data to get the right data.
I have two questions -
1. (How) can I attach or bind additional property (level which could be country,state or office)
2. How can I pass this value to the GetData Action to get the right data.
Does combobox/dropdowns come with client side filtering built in? Should one use comboboxes and not dropdowns for this?
Thnks.
Am considering use of server side filtering and paging for combobox because expecting large number of dropdown values.
What would be the recommended number of values count for which the use of server side filering/paging is recommended? When would one start seeing performance issues with large number of dropdown values?
Thnks.
Your link returns a "not found" error:
https://demos.telerik.com/aspnet-core/tabstrip/events
Is there a guide for creating a Asp.Net core application on Mac OS X using kendo.ui for asp.net core ?
Or just using OS Windows and IDE VisualStudio ?
I have two auto completes working on the main page of this application. One on the header and one that appears when the user resizes the browser down to a smaller screen width/
Both use the same controller ajax action. It seems the first time the user types in the values it take about 5 seconds to render matches. And subsequent searches are instant.
Is there a way to optimize that so that that first search is instant? Please note that the dataset is large. Over 10,000 products. But that data is cached in .NET Core at application startup so it is not hitting the database again on each search or a web service, rather reading from the same cached list. And that list is optimized to contain only two fields, the product name and primary key.
Is there a way to pre-read the data for the list to make it faster?
Thanks
Wanting to add tooltips to column headers on the grid.
Trying:
$(document).ready(function () {
//grid header tooltip
$('thead [data-title]').kendoTooltip({
content: function (e) {
return $(e.target).text();
},
});
})
Seems to work except there appears to be spurious tooltips. Please see attached 1.png and 2.png.
These appear to be from title attributes from within child elements. Please see 3.png and 4.png.
In the case of 3.png the title="" attribute appears to be dynamically added.
Would like to remove the empty title="" tooltip and convert the column menu tooltip due to title="Column Menu" to be of kendoTooltip as well (preferably using single initialization step).