Pregunta

I have a grid using jqGrid and in this grid I have the rows editable with inline editing. I'm trying to do autocomplete in the rows that is editable. Is this possible to do? And in case of yes, how can I identify these rows?

¿Fue útil?

Solución

You could set the classes: autoCompleteFieldClassName in the colModel of the column, and then use that to add in your auto complete fields on edit.

Example: in the colModel you can assign a class to the column cells via the option classes: autoCompleteFieldClassName

This class would then allow you to set a jQuery selector on the inline edit event which would allow you to select the input element attached to this cell column. Once you have this element you can attach an jQuery autocomplete

$(inputElement).autocomplete({ source: '/Controller/GetAutocompleteInformation',
    minLength: 2, autosearch: true,
    select: function (event, ui) {
        $(elem).val(ui.item.value);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top