Kendo UI高亮显示网格中的文本 [英] Kendo UI Highlight Text in Grid
问题描述
我正在尝试突出显示Kendo网格中的文本.我正在使用 jQuery Highlight插件!突出显示文本.
I am trying to highlight text within a Kendo grid. I am using jQuery Highlight Plugin! to highlight the text.
我能够针对普通的旧html网格使用Highlight插件.但是,当我尝试引用Kendo生成的网格时,无法使突出显示起作用.
I am able to use the highlight plugin against plain old html grids. However, when I try to reference a grid generated by Kendo, I cannot get the highlight to work.
这是我的MVC页面中的代码段.
Here is a snippet of the code from my MVC page.
<div id="grid">
@(Html.Kendo().Grid<MyModel>()...
</div>
我使用浏览器(IE,Chrome)查看了呈现的代码,并发现其中有一个< script>与网格关联的标签.我将呈现的HTML和< script>标签,然后将其插入我的页面以验证突出显示是否正常工作.
I looked at the rendered code with my browser (IE, Chrome), and noticed there was a <script> tag associated with the grid. I took the rendered HTML and <script> tag from the browser and plugged into my page to verify highlight is working.
当我删除以下标签时,请突出显示作品.当它出现在屏幕上时,突出显示不起作用.
When I remove the following tag, highlight works. When it appears in the appear, highlighting does not work.
<script>
jQuery(function () { jQuery("#grid6cbf1150-e10f-4df3-890b-85d9b3e754e0").kendoGrid( ... ); });
</script>
所以问题是,该标签在做什么以防止突出显示起作用?
So the question is, what is this tag doing to prevent the highlight from working?
谢谢.
推荐答案
我尝试了hightlight演示,它似乎运行良好.检查我创建的以下示例:
I tried the hightlight demo and it seems to be working fine. Check the following example I created:
别忘了在页面中添加样式,以便您看到实际的亮点:
Do not forget to add the styles to your page so you can see the actual hightlight:
<style>
.highlight {
background-color: #FFFF88;
}
</style>
这篇关于Kendo UI高亮显示网格中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!