Editing a row shows ID instead of name

Editing a row shows ID instead of name

klinglerklingler Posts: 90Questions: 42Answers: 2

Good afternoon (o;

I use an edit form with two jQuery autocomplete fields and use this function to replace the field with the name instead of the ID which works just fine:

                label: "Lieferant",
                name: "supplier",
                type: "autoComplete",
                opts: {
                    select: function (event, ui) {
                        event.preventDefault();
                        $(this).val(ui.item.label);
                        carteditor.val('SupplierID', ui.item.value);
                    }
                }

Now when I edit that row again, the ID is displayed in those autoComplete fields instead of the previous filled in name.

Is there a trick to fill there the name again from autoComplete?

thanks in advance
richard

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Hi Richard,

    Yup - this is the reason I don't use jQuery UI AutoComplete myself. I find it really difficult to have it use a label / value pair properly!

    Various SO posts on this topic with jQuery UI suggest that you need to use the focus event handler as well - e.g. this one.

    Allan

This discussion has been closed.