2009-11-13 172 views
0

的HTML:getGridParam不是函數

<a href="javascript:void(0)" id="m1">Get Selected id's</a> 

的功能:

jQuery("#m1").click(function() { 
    var s; 
    s = jQuery("#list4").getGridParam('selarrrow'); 
    alert(s); 
}); 

我有網格 「#list4」 的數據,但它會導致一個錯誤:getGridParam is not a function. 請幫我排序解決問題。謝謝。

+0

據我所知,一個名爲'getGridParam'的函數不是jQuery核心的一部分。你在使用插件嗎? – 2009-11-13 05:16:47

+0

是的,我正在使用插件。 – AMAR 2009-11-16 04:54:41

回答

0

它似乎是你使用JGRID插件。

可能有三種可能的問題:

  • 你沒有正確調用getGridParam功能(錯誤的號碼則params的)。
  • 您沒有正確導入與庫相關的JS文件。
  • 您正在對不支持它的對象調用getGridParam。

我檢查了JGRID的維基,看到您正在使用該方法。

getGridParam name mixed value 

Returns the value of the requested parameter. name is the name from the options array. If the name is not set, the entry options are returned. For available options, see options.

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods

這導致我相信你可能是在提醒使用DOM元素實際上不是#grid的方法。

請提供更多代碼使其更容易幫助。