属性'jqGrid'在'JQuery'类型的值上不存在 [英] The property 'jqGrid' does not exist on value of type 'JQuery'

查看:105
本文介绍了属性'jqGrid'在'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屋!

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