Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 未定义不是jqGrid中的函数_Jquery_Zend Framework_Jqgrid - Fatal编程技术网

Jquery 未定义不是jqGrid中的函数

Jquery 未定义不是jqGrid中的函数,jquery,zend-framework,jqgrid,Jquery,Zend Framework,Jqgrid,我试着设置jqGrid。我将它与zend framework 2一起使用,并将这些脚本附加到我的视图中 echo $this->headScript()->prependFile($this->basePath( 'js\jquery.min.js' ) ); echo $this->headScript()->prependFile($this->basePath( 'js\jquery-jqGrid\jquery.jqGrid-4.6.0\js\jquer

我试着设置jqGrid。我将它与zend framework 2一起使用,并将这些脚本附加到我的视图中

echo $this->headScript()->prependFile($this->basePath( 'js\jquery.min.js' ) );
echo $this->headScript()->prependFile($this->basePath( 'js\jquery-jqGrid\jquery.jqGrid-4.6.0\js\jquery.jqGrid.src.js' ) );
echo $this->headScript()->prependFile($this->basePath( 'js\myScript.js' ) )
然而,我在尝试做这件事时却犯了一个错误

$( document).ready( function( ) {
jQuery("#editgrid").jqGrid({
    url:'editing.php?q=1',
    datatype: "xml",
    colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
    colModel:[
        {name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10}},
        {name:'invdate',index:'invdate', width:80,editable:true,editoptions:{size:10}},
        {name:'name',index:'name', width:90,editable:true,editoptions:{size:25}},
        {name:'amount',index:'amount', width:60, align:"right",editable:true,editoptions:{size:10}},
        {name:'tax',index:'tax', width:60, align:"right",editable:true,editoptions:{size:10}},
        {name:'total',index:'total', width:60,align:"right",editable:true,editoptions:{size:10}},
        {name:'closed',index:'closed',width:55,align:'center',editable:true,edittype:"checkbox",editoptions:{value:"Yes:No"}},
        {name:'ship_via',index:'ship_via',width:70, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;TN:TNT"}},
        {name:'note',index:'note', width:100, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"20"}}
    ],
    rowNum:10,
    rowList:[10,20,30],
    pager: '#pagered',
    sortname: 'id',
    viewrecords: true,
    sortorder: "desc",
    caption:"Editing Example",
    editurl:"someurl.php"
});
$("#bedata").click(function(){
    var gr = jQuery("#editgrid").jqGrid('getGridParam','selrow');
    if( gr != null ) jQuery("#editgrid").jqGrid('editGridRow',gr,{height:280,reloadAfterSubmit:false});
    else alert("Please Select Row");
});

选择器editgrid很好,并且包含了myScript,因此您缺少的其他文件(包括JavaScript中的语言文件)也包含了myScript

~src/i18n/grid.locale-en.js


您可能还需要jquery-ui.js和相关的.css文件。

我现在添加了它,但仍然会遇到同样的错误,我认为它也必须在jqgrid脚本之前。这是一个问题,可能会也可能不会解决你的问题。不工作,顺便说一句,我下载了4.6。我指定了jqueryuicss、jqGrid css、locale和jqgridjqueryeditgrid是否返回必需的元素?还有哪一行显示的错误?jest jQueryeditgrid正在返回元素错误在jQueryeditgrid.jqGrid的正下方{在grid.locale-en.js中,它说jQuery没有定义,但我包含了它。确保的一个方法是查看页面源代码,然后尝试打开js链接,它们应该是Mozilla中的可点击链接,您可能已经包含了它们,但它们是404,链接正确。