JSFiddle - React, Tailwind, and code Playground

by epinapala

JavaScript

$(”#querieslist”)..jqGrid({
            // … some grid options …
            colModel: [{ // ... some column definitions ... },
                        {
                            name: 'my_customId',
                            index: 'my_customId',
                            editable: true,
                            hidden: true,
                            search: false
                        }, {
                            name: 'my_customName',
                            index: 'my_customName',
                            label: 'My automplete column',
                            width: 200,
                            editable: true,
                            edittype: 'text', // edittype's default is 'text' so you don't really need it here. 
                            editoptions: {
                                size: 64,
                                maxlength: 255,
                                dataInit: function (elem) { // the moment of magic Wink
                                    $(elem)
                                        .autocomplete('path_to_serverside.php?some_get_option=if_we_need_it&another_option=goes_here', {
                                            dataType: 'ajax',
                                            multiple: false,
                                            parse: function (data) { // parsing json input
                                                return $.map(eval(data), function (row) {
                                                    return (typeof (row) == 'object') ? {
                                                            data: row,
                                                            value: row.res_id,
                                                            result: row.res_name
                                                        } // same in the serverside
                                                        : {
                                                         ...