我有一个带有自动完成列的jqGrid(使用内联编辑)。当用户从自动填充列中选择一个值时,事件处理程序将在另一列上设置一个值,并将自动填充列的值设置为除自动填充源返回的label
之外的值。两个列定义(完成这里jsFiddle示例):jqGrid内联编辑:具有自动完成列的奇怪行为
{
name: 'cartoonId',
index: 'cartoonId',
width: 90,
editable: false},
{
name: 'cartoon',
index: 'cartoon',
width: 200,
editable: true,
edittype: 'text',
editoptions: {
dataInit: function(elem) {
$(elem).autocomplete({
source: autocompleteSource,
select: function(event, ui){
var rowId = $("#inlineGrid").jqGrid('getGridParam', 'selrow');
if(ui.item){
$("#inlineGrid").jqGrid('setCell', rowId, 'cartoonId', ui.item.CartoonId);
$("#inlineGrid").jqGrid('setCell', rowId, 'cartoon', ui.item.Name);
}
return false;
}
});
}
}},
的问题是,只要用户选择从自动完成,或者通过点击它,或使用箭头并按Tab键的值,该小区不再可编辑,网格似乎完全失去焦点。如果我注释掉设置单元格值的行,则表现正常。有什么办法可以解决这个问题吗?我需要整行保持编辑模式,包括cartoon
列,直到用户完成编辑。
的jqGrid 4.4.1
的jQuery 1.7.2
jQuery UI的1.8.18
你又救了我,奥列格。谢谢!! –
@AJ:不客气! – Oleg