属性'jqGrid'在'JQuery'类型的值上不存在 [英] The property 'jqGrid' does not exist on value of type 'JQuery'
问题描述
我正在使用带有jqGrid和jQuery的Typescript。
I am using Typescript with jqGrid and jQuery.
在以下行中:
jQuery(this).jqGrid('editGridRow', rowid, {
...
我收到消息:
属性'jqGrid'在'JQuery'类型的值上不存在。
The property 'jqGrid' does not exist on value of type 'JQuery'.
关于如何纠正这个问题的任何想法?
Any ideas on how to correct this problem?
推荐答案
我想你使用 jquery.TypeScript.DefinetlyTyped NuGet包。
I suppose that you use jquery.TypeScript.DefinetlyTyped NuGet Package.
在这种情况下添加文件〜 /Scripts/typings/custom.d.ts ,内容如下:
In that case add file ~/Scripts/typings/custom.d.ts with following content:
/// <reference path="jquery/jquery.d.ts"/>
interface JQuery { jqGrid: any; }
更新:
以上解决方案是通用的,适用于所有情况。更好的解决方案是......
Update: Above solution is general and works in all cases. Better solution is to...
安装 jqgrid.TypeScript.DefinitelyTyped NuGet Package。
Install jqgrid.TypeScript.DefinitelyTyped NuGet Package.
这篇关于属性'jqGrid'在'JQuery'类型的值上不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!