Is it possible to extend the Telerik MVC Grid toolbar to include custom commands? I'm looking to add my own functionality to the toolbar, and I'm wondering if there's a way to create a method within the toolbar command factory to generate buttons with specific functionality that I want to apply across all grids in my application.
For example, I have these three methods I have added using the toolbar template.
instead of using the template every time I would like to add custom command like save or excel.
I have an application with a Kendo MVC ToolBar including buttons with french text or including ampersands such as "R&D".
This used to display correctly as "R&D" but since a recent update of the Telerik MVC controls, it displays encoded as "R&D".
If there is an apostrophe, a text like "En attente d'approbation" will show as "En attente d'approbation".
I can reproduce this problem in your demos, for example see:
Kendo UI demo
https://dojo.telerik.com/ErEXiBul
Telerik MVC demo
https://dojo.telerik.com/egulokat
Is there any way to get this to display as expected? I tried different things but it always show up with & text on the screen which is bad.
Thank you!
Hello, I have a kendo grid in /employees/grid where there is an edit button on the line opening an edit popup
1. Would you like to put this button on another page /consultation/paycheck to open this edit popup?
2. or open this grid /employees/grid in a popup on another page?
thank you
Hi,
I have kendo mvc grid in my application and I am using toolbar to save the changes in the grid, Toolbar is coming on the top of the kendo grid. I want to add Toolbar at both top and bottom of the grid, please suggest me to achieve it.
I had a dropdownlist in a page populated like so
@(Html.Kendo().DropDownList()
.Name(
"domain"
)
.DataTextField(
"DomainName"
)
.DataValueField(
"DomainName"
)
.DataSource(dataSource =>
dataSource.Read(read =>
read.Action(
"GetDomainNames"
,
"MinMax"
))
)
)
public
JsonResult GetDomainNames()
{
var dictDomains =
new
Dictionary<
string
,
string
>();
using
(var inoAutoEntities =
new
InoAutoEntities(InoAutoEntitiesHelper.GetEntityString(InoAutoEntitiesHelper.GetCredents())))
{
var localSettings = inoAutoEntities
.Settings
.Where(item => item.Machine ==
"."
)
.ToDictionary(item => item.Name);
if
(localSettings[
"UseAutomatedControlService"
].Value==
"True"
)
{
foreach
(var domain
in
inoAutoEntities.CartSideDomains.GroupBy(item => item.Domain).Select(item => item.Key))
{
dictDomains.Add(domain, domain);
}
}
else
{
var carts = inoAutoEntities.CartControls.Where(item => item.TypeControl == (
int
)ETypeControl.Owner).ToList();
foreach
(var cartControl
in
carts)
{
if
(!dictDomains.ContainsKey(cartControl.Domain))
{
dictDomains.Add(cartControl.Domain, cartControl.Domain);
}
}
}
}
var returnList = dictDomains
.Keys
.OrderBy(item => item)
.ToList();
returnList.Insert(0,
"All Domains"
);
var result = returnList.Select(item =>
new
DomainModel() {DomainName = item}).AsEnumerable();
return
Json(result,JsonRequestBehavior.AllowGet);
}
I wanted to move the dropdownlist to a toolbar but i see that the only way to do that is to use javascript to initialize
what is the syntax that would allow me to populate using a datasource that calls the controller action. I could not find information in the
documentation for toolbar or dropdownlist. any help would be appreciated
@(Html.Kendo().ToolBar()
.Name(
"ToolBar"
)
.Items(items =>
{
items.Add().Template(
"<div><label>Labels:</label><input id='labels' style='width: 150px;' /></div>"
).OverflowTemplate(
"<span></span>"
);
}
)
)
<script type=
"text/javascript"
>
$(document).ready(
function
() {
$(
"#labels"
).kendoDropDownList({
dataTextField:
"DomainName"
,
dataValueField:
"DomainName"
});
});
</script>
Hello All, I am actually usingl ocalization for displaying texts in Window title,
In the .resx file i have a text like PopUpAjouter_Titre: Saisie d'une écriture .
In .cshtml file i am using this syntax to display the value
@(Html.Kendo().ToolBar().Name("ToolBar").Resizable(false)
.Items(items =>
{
items.Add().Type(CommandType.Button).Id("btnRefresh").SpriteCssClass("k-i-reload").ShowIcon(ShowIn.Both).HtmlAttributes(new { @title = Web.Resources.Views.TView.Action_Refresh, @class = "k-button-rond-ext" });
items.Add().Type(CommandType.Separator).HtmlAttributes(new { @style = "border-color: rgba(0,0,0,0.08);" });
items.Add().Type(CommandType.Button).Id("btnAjouter").SpriteCssClass("k-i-add").ShowIcon(ShowIn.Both).HtmlAttributes(new { @title = Web.Resources.Views.TView.Action_CreationEcritures, @class = "k-button-rond-ext",
data_titre = Web.Resources.Views.TView.PopUpAjouter_Titre)
});
}))
when this page is rendered in the chrome browser the html tag is displayed like below
<
a
role
=
"button"
href
=
""
tabindex
=
"0"
title
=
"Création"
class
=
"k-button-rond-ext k-button k-button-icon"
data-titre
=
"Saisie d#39;une écriture"
id
=
"btnAjouter"
data-uid
=
"52af038a-512d-4456-bc78-1cd9cfe83fdd"
data-overflow
=
"auto"
aria-disabled
=
"false"
><
span
class
=
"k-sprite k-icon k-i-add"
></
span
></
a
>
and the actual text is not displaye the singlequote or apostrophe is displayed as '
But when i display the same value in a Paragraph like,<
p
>@Web.Resources.Views.TView.PopUpAjouter_Titre</
p
>
it is displayed like this in the chrome browser, <
p
>Saisie d'une écriture de trésorerie</
p
>
If anyone has encountered this issue, please help me.
Regards,
NAIDU Geetha
Hi,
If I change the text of a button it removes span and other classes as well.
This is my code but doesn't work.
@(Html.Kendo().Menu()
.Name("HeaderMenu")
.Items(items =>
{
items.Add().Text("Home").Action("Index", "Home").SpriteCssClasses("fa fa-home");
items.Add().Text("About").Action("About", "Home").SpriteCssClasses("fa fa-info");
items.Add().Text("Contact").Action("Contact", "Home").SpriteCssClasses("fa fa-mobile-phone");
items.Add().Text("User").HtmlAttributes(new { id = "userloggedin" }).SpriteCssClasses("fa fa-user").Items(children => {
children.Add().Text("Sign out").SpriteCssClasses("fa fa-sign-out").HtmlAttributes(new { id = "signout" }).Enabled(false);
});
}))
<script type="text/javascript">
function onButtonClick(e) {
var html = $("#userloggedin").children(".k-link").html();
console.log(html);
$("#userloggedin").children(".k-link").text("It is me!");
html = $("#userloggedin").children(".k-link").html();
console.log(html);
}
</script>