Enrico
Enrico

Reputation: 3443

Kendo UI for aspnet core : How to set the placeholder text?

I'm using Kendo ui for aspnet core MVC. And I can't find out how to set the placeholder text. enter image description here

I'm configuring the grid search like this

 .ToolBar(tools => tools.Search())
    .Search(s => { s.Field(c => c.IncidentEvent); })

Is there a way to set the "Search..." text, without having to write custom Jquery code? I mean I know it can be achieved by doing:

$(".k-grid-toolbar .k-input")[0].placeholder = "Search Incident Event...";

But is there really no better and cleaner way?

Upvotes: 0

Views: 728

Answers (1)

David
David

Reputation: 6111

ToolBar.Search.Text is what you're looking for: https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/GridToolBarSearchCommandBuilder#textsystemstring

The alternative would be to set the ToolBar.Search.Template and set it manually: https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/GridToolBarCommandFactory#templatesystemstring

Upvotes: 1

Related Questions