通过ajax将jqgrid加载到对话框搜索选项下拉列表不起作用
当我使用我的jqgrid v.4.6时,每一页都是可以的。 当我通过ajax将jqgrid加载到jquery对话框searchoptions下拉列表时,这个列表对我不起作用。 在jqgrid搜索框中,searchoptions下拉列表也不适用于我通过ajax将jqgrid加载到对话框搜索选项下拉列表不起作用,ajax,jqgrid,Ajax,Jqgrid,当我使用我的jqgrid v.4.6时,每一页都是可以的。 当我通过ajax将jqgrid加载到jquery对话框searchoptions下拉列表时,这个列表对我不起作用。 在jqgrid搜索框中,searchoptions下拉列表也不适用于我 $(document).ready(function(){ jQuery("#list_bs").jqGrid({ url:'some.php', datatype: "json", height: 450,
$(document).ready(function(){
jQuery("#list_bs").jqGrid({
url:'some.php',
datatype: "json",
height: 450,
width: 1050,
colNames:['FirstName','Name','Date'],
colModel:[
{name:'FirstName',index:'FirstName', width:200, sorttype:'string', searchoptions:{sopt:['bw','bn','cn','ne','ew','en']}},
{name:'Name',index:'Name', width:200, sorttype:'string', searchoptions:{sopt:['bw','bn','cn','ne','ew','en']}},
{name:'Date',index:'Date', width:100, sorttype:'string', searchoptions:{sopt:['bw','bn','cn','ne','ew','en']}},
],
rowNum:50,
rowList : [20,30,50],
loadonce:false,
multiselect : false,
mtype: "GET",
shrinkToFit: false,
rownumbers: true,
gridview: true,
pager: '#pager',
sortname: 'Name',
viewrecords: true,
sortorder: "ASC",
toolbar: [true,"top"],
});
$("#list_bs").jqGrid('navGrid', '#pager_bs',
{
edit:false,
add:false ,
del:false,
},
{},
{},
{},
{
multipleSearch: true,
showQuery: true
}
......
)
});
jQuery("#list_bs").jqGrid('filterToolbar',{ searchOperators: true,stringResult:true, searchOnEnter: false, autosearch: true ,enableClear: false});
试着像下面这样为我工作。你已经在它的列模型的下拉列表中给出了数据
{
name: 'Name', Name: 'Title', align: 'center', editable: true, editoptions: { readonly: 'readonly' },
stype: 'select',
searchoptions: {
sopt: ['eq','cn'],
dataUrl: //get data from server
buildSelect: function (data) {
var response, s = '<select>', i;
response = jQuery.parseJSON(data);
s += '<option value="0">--Select Book Title--</option>';
if (response && response.length) {
$.each(response, function (i) {
s += '<option value="' + this.Name+ '">' + this.Name+ '</option>';
});
}
return s + '</select>';
}
}
}
我不需要在工具栏输入下拉菜单 我的搜索操作员下拉列表未打开。 问题是只有当我自己的jqgrid被ajax加载到jquery对话框中时
$( "#my_dialog" ).dialog({
width:'auto',
open: function(event, ui){
$.ajax(
{
url: "some.php",
type: "POST",
data: "is_dialog=true",
error: function(){
},
beforeSend: function(){
$("#loader").show();
},
complete: function(){
$("#loader").hide();
},
success: function( strData ){
$("#dialog_content").html(strData );
}
}
);
},
});
...........
<div id="my_dialog" >
<div id="dialog_content"></div>
</div>