Jqgrid DropDownList无法在selectRow上正确刷新

时间:2019-06-12 18:55:39

标签: drop-down-menu jqgrid items

I have a jquery grid with dropdown list. List items of dropdownlist should be changed according to operation in grid. When I edit existing row, js function  "getSoortEditfuncWithAllListItems()" called. It's working fine and when I add new row ,js function "getSoortAddNewRowfuncWithOnlyActiveListItems();" called. This all happens in SelectRow event. But here problem is - If i first edited row, then dropdown in jquery filled with all (active and non active)items.Then if click on Add button for add new row,js function "getSoortAddNewRowfuncWithOnlyActiveListItems()" called,but this new list(only active items) not reflects in dropdownlist. It shows same All Active,nonactive list. If I click again on add button then it's shows only active items.

刷新不正常。

    onSelectRow: function (id) { 
    var f1Val = $('#jQGridCountry').jqGrid('getCell', id, 'Soort');
    if (f1Val.length > 0) {
    var values = getSoortEditfuncWithAllListItems(); // This is for Edit 
    Row
    alert(' var values = getSoortEditfuncWithAllListItems();')
    jQuery('#jQGridCountry').setColProp('Soort', { editoptions: { value: 
    null} 
    });
    jQuery('#jQGridCountry').setColProp('Soort', { editoptions: { value: 
    values } 
    });
    }
    else {                                 
    var values = getSoortAddNewRowfuncWithOnlyActiveListItems(); // This is 
    for Add New Row
    alert(' var values = getSoortAddNewRowfuncWithOnlyActiveListItems();')
    jQuery('#jQGridCountry').setColProp('Soort', { editoptions: { value: 
    null} });
    jQuery('#jQGridCountry').setColProp('Soort', { editoptions: { value: 
    values } });
    }
    } 

对于添加新行-下拉列表应刷新,活动项目列表应刷新    填充。

0 个答案:

没有答案