jqGrid自动完成onitemSelect事件未触发 [英] jqGrid Autocomplete onitemSelect event not firing
本文介绍了jqGrid自动完成onitemSelect事件未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友,
我在jqGrid上工作.在这种情况下,我必须在单元格本身中进行编辑.
在编辑配方名称时,它们应为Autocmplete.我正在获取Auotocomplte.
但是当我由Kyebord选择它时,它没有被选中.但是如果我用鼠标选择了任何值,它就会被选中.
我不知道是什么问题.我正在提供以下代码.
Hi Friends,
I am working on jqGrid. In that i have to edit in cell itself.
While editing Recipe Name their should be Autocmplete.I am getting Auotocomplte.
But when i select it by Kyebord, its not getting Selected.But if i select any value with mouse its get selected.
I don''t know what is the problem. I am providing the code below.
$("#Top10Recipes").jqGrid({
url:'Handlers/Top10RecipeHandler.ashx',
editurl:'Handlers/Top10RecipeHandler.ashx',
datatype:"xml",
mytype:"GET",
width:736,
height:"100%",
colNames:['Sequnce','Recipe Name','Modified By','Modified On'],
colModel:[
{name:'Top10RecipeID',index:'Top10RecipeID',editable:false,width:60},
{name:'RecipeName',index:'RecipeName',editable:true,edittype: 'text',editoptions:{dataInit:function(elem){
setTimeout(function(){ //alert(elem);
$(elem).autocomplete("Handlers/AutocompleteHandler.ashx",{
matchContains: true,
minChar: 0,
//onItemSelect:elem,
autoFill:true
});
$(elem).result(function(event, data, formatted){ ///here i m not getting event properly
if (data) {
$("#Top10RecipeID").val(data[0]);
}
});
},200)
}
},editrules: { required: true }
},
{name:'ModifiedBy',index:'ModifiedBy',editable:false},
{name:'ModifiedOn',index:'ModifiedOn',editable:false,sorttype: 'datetime'}
],
pager:pager,
caption:"Top 10 Recipes",
sortname:"Top10RecipeId",
cellEdit:true,
rowNum:10,
sorttype:'Asc',
rowList:[10,20,30],
viewrecord:true,
cellsubmit:'clientArray',
afterSaveCell:function(rowid,name,val,iRow,iCol){
if(name=='RecipeName'){
$.post("Handlers/Top10RecipeHandler.ashx",{oper:'edit',id:rowid,value:val},function(data){});
}
}
}).navGrid("#pager",{edit:true,add:false,del:true,search:true},
{ reloadAfterSubmit: true, jqModel: true, closeOnEscape: true}, //edit
{reloadAfterSubmit: true, jqModel: true, closeOnEscape: true, closeAfterAdd: true}, //add
{reloadAfterSubmit: true, jqModel: true, closeOnEscape: true, closeAfterAdd: true}//del
)
希望我能说清楚.
请在这方面帮助我.
在此先感谢.
I hope i am making it clear.
please help me in this regard.
Thanks in Advance.
推荐答案
(" ).jqGrid({ 网址:' Handlers/Top10RecipeHandler.ashx', editurl:' Handlers/Top10RecipeHandler.ashx', 数据类型:" , mytype:" , 宽度: 736 , 高度:" , colNames:[' 序列',' 食谱名称',' 修改人' ,' 修改为'], colModel:[ {name:' Top10RecipeID',索引:' Top10RecipeID',可 false ,宽度: 60 }, {name:' RecipeName',索引:' RecipeName',可 true ,edittype:' 文本',编辑选项:{dataInit:function(elem){ setTimeout(function(){// alert(elem);
("#Top10Recipes").jqGrid({ url:'Handlers/Top10RecipeHandler.ashx', editurl:'Handlers/Top10RecipeHandler.ashx', datatype:"xml", mytype:"GET", width:736, height:"100%", colNames:['Sequnce','Recipe Name','Modified By','Modified On'], colModel:[ {name:'Top10RecipeID',index:'Top10RecipeID',editable:false,width:60}, {name:'RecipeName',index:'RecipeName',editable:true,edittype: 'text',editoptions:{dataInit:function(elem){ setTimeout(function(){ //alert(elem);
(elem).autocomplete(" ,{ matchContains: true , minChar: 0 , // onItemSelect:elem autoFill:为真 });
(elem).autocomplete("Handlers/AutocompleteHandler.ashx",{ matchContains: true, minChar: 0, //onItemSelect:elem, autoFill:true });
(elem).result(function(事件,数据,已格式化){此处无法正确获取事件 如果(数据){
(elem).result(function(event, data, formatted){ ///here i m not getting event properly if (data) {
这篇关于jqGrid自动完成onitemSelect事件未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文