Kendo UI-如何在NumerictExtBox Control中本地化自旋框的工具提示



如何本地化/更改kendo ui ui numerictextbox Control中的旋转框的工具提示文本?

是的,我遇到了同样的问题。由于某些原因

if (kendo.ui.NumericTextBox) {
    kendo.ui.NumericTextBox.prototype.options =
    $.extend(true, kendo.ui.NumericTextBox.prototype.options,{
      "upArrowText": "Increase value",
      "downArrowText": "Decrease value"
    });
}

要本地化文本,您只需在Kendo包含之后就包含相应的消息脚本。scriptlink取自有关本地化的Kendos文档:

例如:

$("#numeric").kendoNumericTextBox();
<link href="http://kendo.cdn.telerik.com/2018.1.221/styles/kendo.common.min.css" rel="stylesheet"/>
<script src="http://kendo.cdn.telerik.com/2018.1.221/js/jquery.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2018.1.221/js/kendo.all.min.js"></script>
<!-- This is the important line, you may need to change de-DE to your desired locale -->
<script src="http://kendo.cdn.telerik.com/2018.1.221/js/messages/kendo.messages.de-DE.min.js"></script>
<p>Hover over the up or down caret to see the german texts:</p>
<input id="numeric" type="number" title="numeric" value="17" min="0" max="100" step="1" />

您可能需要检查kendo-ui-core存储库中的可用本地化文件或其文档。

请注意,这是消息脚本的操作方式(另一个答案中已经显示):

/* NumericTextBox messages */
if (kendo.ui.NumericTextBox) {
  kendo.ui.NumericTextBox.prototype.options =
  $.extend(true, kendo.ui.NumericTextBox.prototype.options,{
    "upArrowText": "Increase value",
    "downArrowText": "Decrease value"
  });
}

因此,您应该能够自己自定义这些文本。

最新更新