Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.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_Asp Classic_Jqgrid - Fatal编程技术网

Jquery 在jqgrid上实现搜索功能?

Jquery 在jqgrid上实现搜索功能?,jquery,asp-classic,jqgrid,Jquery,Asp Classic,Jqgrid,我太努力了,我不明白我的代码中缺少了什么 ASP: JavaScript: var lastsel; $(function() { $("#list").jqGrid({ url: 'orders.cs.asp?Process=ViewOrders', datatype: 'xml', mtype: 'Get', height: '100%', colNames: ['Actions','ID #','Custo

我太努力了,我不明白我的代码中缺少了什么

ASP:

JavaScript:

var lastsel;

$(function() {

$("#list").jqGrid({
        url: 'orders.cs.asp?Process=ViewOrders',
        datatype: 'xml',
        mtype: 'Get',
        height: '100%',
        colNames: ['Actions','ID #','Customer', 'Date', 'Status','Total','Tracking #'],
        colModel: [
            {name:'Actions', index:'Actions', width:65, sortable:false, search:false},
            {name:'ID', index:'ID', width:30},
            {name:'Customer', index:'Customer', width:150},
            {name:'Date', index:'Date', width:150},
            {name:'TransactStatus', index:'TransactStatus', width:130, editable:true, edittype:"select", editoptions:{value:"Pending:Pending;Awaiting Payment:Awaiting Payment;Awaiting Fulfillment:Awaiting Fulfillment;Awaiting Shipment:Awaiting Shipment;Awaiting Pickup:Awaiting Pickup;Partially Shipped:Partially Shipped;Completed:Completed;Shipped:Shipped;Cancelled:Cancelled;Declined:Declined;Refunded:Refunded"}},
            {name:'Total', index:'Total', width:80, align:"right"}, 
            {name:'ShipTrackingNumber', index:'ShipTrackingNumber', width:126, editable:true}, 
        ],
        pager: jQuery('#pager'),
        rowNum: 10,
        rowList: [10,20,30],
        sortname: 'Date', 
        sortorder: 'desc',
        viewrecords: true,
        subGrid : true, 
        subGridUrl: 'orders.cs.asp?Process=ViewOrderDetails', 
        subGridModel: [ {
            name: ['Quantity','Product','-', '-', '-'],
            width : [65,350,50,50,50], 
            param: ['invdate']
            } 
        ],
        imgpath: 'js/jqGrid/themes/basic/images',
        onSelectRow: function(id) { 
            if(id && id!==lastsel) {
                $('#list').restoreRow(lastsel); 
                $('#list').editRow(id,true); 
                lastsel=id; 
                } 
            }, 
        loadComplete: function(){ 
            var ids = jQuery("#list").getDataIDs(); 
            for(var i=0;i<ids.length;i++){ 
                var cl = ids[i]; 
                be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=jQuery('#list').editRow("+cl+"); ></ids>"; 
                se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=jQuery('#list').saveRow("+cl+"); />"; 
                ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=jQuery('#list').restoreRow("+cl+"); />"; 
                jQuery("#list").setRowData(ids[i],{Actions:be+se+ce}) 
            } 
        }, 
        editurl: "orders.cs.asp?Process=EditOrder",
}).navGrid("#pager",{edit:true,add:false,del:false});   

});
var-lastsel;
$(函数(){
$(“#列表”).jqGrid({
url:'orders.cs.asp?Process=ViewOrders',
数据类型:“xml”,
mtype:'获取',
高度:“100%”,
colNames:['Actions','ID','Customer','Date','Status','Total','Tracking',],
colModel:[
{name:'Actions',index:'Actions',width:65,sortable:false,search:false},
{名称:'ID',索引:'ID',宽度:30},
{名称:'Customer',索引:'Customer',宽度:150},
{名称:'Date',索引:'Date',宽度:150},
{名称:'Transact-Status',索引:'Transact-Status',宽度:130,可编辑:true,编辑类型:“选择”,编辑选项:{值:“待定:待定;等待付款:等待付款;等待履行:等待履行;等待装运:等待装运;等待提货:等待提货;部分装运:部分装运;完成:完成;装运:装运;取消:取消;拒绝:拒绝;退款:退款”},
{名称:'Total',索引:'Total',宽度:80,对齐:“right”},
{名称:'ShipTrackingNumber',索引:'ShipTrackingNumber',宽度:126,可编辑:true},
],
pager:jQuery(“#pager”),
rowNum:10,
行列表:[10,20,30],
sortname:'日期',
排序器:“desc”,
viewrecords:是的,
子网格:对,
subGridUrl:'orders.cs.asp?Process=ViewOrderDetails',
子网格模型:[{
名称:['数量','产品','-','-','-',
宽度:[65350,50,50,50],
参数:['invdate']
} 
],
imgpath:'js/jqGrid/themes/basic/images',
onSetRow:函数(id){
if(id&&id!==lastsel){
$(“#列表”).restoreRow(lastsel);
$('#list').editRow(id,true);
lastsel=id;
} 
}, 
loadComplete:函数(){
var id=jQuery(“#list”).getDataId();

例如,对于(var i=0;i当我尝试搜索时,获取customer列包含Yavuz的所有客户

然后我得到以下错误(我可以在firebug中看到):在预期条件的上下文中指定的非布尔类型的表达式,靠近'。


您的SQL语句可能有问题。您需要告诉use您打算使用什么以及出现了什么问题。这可能会有所帮助:它不起作用,也不会出现任何错误。我认为演示网站是显示问题的最佳方式。如果发送到jqGrid的xml包含一些ord,可能会有所帮助呃,现在它不包含任何数据来填充JQGrid事实上,我为你输入了11条记录来查看它的运行情况。奇怪的是,我在查看数据库时可以看到行,但在查看顺序页面中看不到它们??我现在会晕过去的。我忘了使用“after%”…Torres非常感谢!你刚刚救了我的精神健康。
var lastsel;

$(function() {

$("#list").jqGrid({
        url: 'orders.cs.asp?Process=ViewOrders',
        datatype: 'xml',
        mtype: 'Get',
        height: '100%',
        colNames: ['Actions','ID #','Customer', 'Date', 'Status','Total','Tracking #'],
        colModel: [
            {name:'Actions', index:'Actions', width:65, sortable:false, search:false},
            {name:'ID', index:'ID', width:30},
            {name:'Customer', index:'Customer', width:150},
            {name:'Date', index:'Date', width:150},
            {name:'TransactStatus', index:'TransactStatus', width:130, editable:true, edittype:"select", editoptions:{value:"Pending:Pending;Awaiting Payment:Awaiting Payment;Awaiting Fulfillment:Awaiting Fulfillment;Awaiting Shipment:Awaiting Shipment;Awaiting Pickup:Awaiting Pickup;Partially Shipped:Partially Shipped;Completed:Completed;Shipped:Shipped;Cancelled:Cancelled;Declined:Declined;Refunded:Refunded"}},
            {name:'Total', index:'Total', width:80, align:"right"}, 
            {name:'ShipTrackingNumber', index:'ShipTrackingNumber', width:126, editable:true}, 
        ],
        pager: jQuery('#pager'),
        rowNum: 10,
        rowList: [10,20,30],
        sortname: 'Date', 
        sortorder: 'desc',
        viewrecords: true,
        subGrid : true, 
        subGridUrl: 'orders.cs.asp?Process=ViewOrderDetails', 
        subGridModel: [ {
            name: ['Quantity','Product','-', '-', '-'],
            width : [65,350,50,50,50], 
            param: ['invdate']
            } 
        ],
        imgpath: 'js/jqGrid/themes/basic/images',
        onSelectRow: function(id) { 
            if(id && id!==lastsel) {
                $('#list').restoreRow(lastsel); 
                $('#list').editRow(id,true); 
                lastsel=id; 
                } 
            }, 
        loadComplete: function(){ 
            var ids = jQuery("#list").getDataIDs(); 
            for(var i=0;i<ids.length;i++){ 
                var cl = ids[i]; 
                be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=jQuery('#list').editRow("+cl+"); ></ids>"; 
                se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=jQuery('#list').saveRow("+cl+"); />"; 
                ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=jQuery('#list').restoreRow("+cl+"); />"; 
                jQuery("#list").setRowData(ids[i],{Actions:be+se+ce}) 
            } 
        }, 
        editurl: "orders.cs.asp?Process=EditOrder",
}).navGrid("#pager",{edit:true,add:false,del:false});   

});