1

First of all, I introduce a text in the city input, city input is autocomplete(Jquery UI), and then I select a locality and press enter. Afterwards I add new field to search. When I press new field, jqgrid clears city field.

UI image

This is a part of my code.

{
        name:'City',
        index:'City',
        width:220, 
        align:"center",
        sortable:true,
        editable:true, 
        edittype:'select',
        editoptions:{
            value:load_City
        },
        stype:'text',
        searchoptions:{
            dataInit:function(el){
                $(el).autocomplete({
                                    selectFirst:true,
                                    source: "Codigo/Datos/localidades.php?autocomplete=verdadero"  
                                    })
             },
        sopt:['eq','ne','lt','le','gt','ge']
        }
    }
Alvaro
  • 13
  • 3

1 Answers1

1

If I understand your problem correctly you should add should trigger change event after new value in autocomplete will be selected:

$(el).autocomplete({
    selectFirst: true,
    source: "Codigo/Datos/localidades.php?autocomplete=verdadero",
    select: function (event) {
        $(el).trigger('change');
    }
});
Oleg
  • 220,925
  • 34
  • 403
  • 798