Kendo Grid验证消息位置问题 [英] Kendo Grid validation message position issue

查看:90
本文介绍了Kendo Grid验证消息位置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发的Kendo网格具有验证消息,但是箭头指向右侧的列.我无法更改/kendo.default.min.css中的任何内容,因为它位于不应更改的共享文件夹中.有什么帮助吗?

The Kendo grid I developed has a validation message, but the arrow points to the column to the right. I cannot change anything in /kendo.default.min.css as this is located in a shared folder which should not be changed. Any help on this?

dataSource: {
  data: data.ReportData,
  schema: {
    model: {
      fields: {
        ProposedDiscount: {
          validation: { 
            required: true,
            proposeddiscountcvalidation: function (input) {
              if (input.val() != "" && input.is("\[name='ProposedDiscount'\]")) {
                  input.attr("data-proposeddiscountcvalidation-msg", "Should be whole number between 0 & 100");
                  // $('.k-widget k-tooltip k-tooltip-validation k-invalid-msg  .k-icon k-warning .k-tooltip-validation .k-callout-n').removeClass('.k-callout-n');
                  return input.val() >= 0 && input.val() < 101 && input.val() % 1 == 0;
              } else {
                  return true;
              }
            }
          }
        }

推荐答案

您可以尝试简单地覆盖验证工具提示上的某些样式.这对我有用,尽管我已经将范围定得很紧,以尽量避免在其他地方出现任何意外的影响.您可能需要稍作修改,具体取决于您使用的是哪种版本的kendo:

You could try simply overriding some of the styles on the validation tool-tip. This works for me, though I've scoped it pretty tight to try to avoid any unexpected effects elsewhere. You might need to modify it slightly, depending on what version of kendo you're using:

<style>
    .k-grid .k-grid-content tr.k-grid-edit-row>td[role='gridcell'] .k-tooltip-validation>.k-callout-n {
        left: auto;
        margin-left: auto;
    }
</style>

我刚刚注意到您说过您无法在/kendo.default.min.css中进行任何更改"-您不需要这样做.这应该覆盖kendo在该文件中提供的默认样式.如果您拥有自己的站点范围的CSS文件,则可以将其添加到该文件中,甚至可以直接将其添加到托管网格的页面中(尽管不建议这样做).希望这会有所帮助.

I've just noticed you said you "cannot change anything in /kendo.default.min.css" - you shouldn't need to. This should override the default styles provided by kendo in that file. If you've got your own site-wide CSS file you could add it to that, or even just add it directly to the page hosting your grid (though that's not really recommended). Hope this helps.

这篇关于Kendo Grid验证消息位置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆