{"action":"created","issue":{"url":"https://api.github.com/repos/tabalinas/jsgrid/issues/1060","repository_url":"https://api.github.com/repos/tabalinas/jsgrid","labels_url":"https://api.github.com/repos/tabalinas/jsgrid/issues/1060/labels{/name}","comments_url":"https://api.github.com/repos/tabalinas/jsgrid/issues/1060/comments","events_url":"https://api.github.com/repos/tabalinas/jsgrid/issues/1060/events","html_url":"https://github.com/tabalinas/jsgrid/issues/1060","id":303826081,"number":1060,"title":"Custom Field Not retaining Value on Edit Mode - Bootstrap TypeHead","user":{"login":"vjkr14","id":4011674,"avatar_url":"https://avatars2.githubusercontent.com/u/4011674?v=4","gravatar_id":"","url":"https://api.github.com/users/vjkr14","html_url":"https://github.com/vjkr14","followers_url":"https://api.github.com/users/vjkr14/followers","following_url":"https://api.github.com/users/vjkr14/following{/other_user}","gists_url":"https://api.github.com/users/vjkr14/gists{/gist_id}","starred_url":"https://api.github.com/users/vjkr14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjkr14/subscriptions","organizations_url":"https://api.github.com/users/vjkr14/orgs","repos_url":"https://api.github.com/users/vjkr14/repos","events_url":"https://api.github.com/users/vjkr14/events{/privacy}","received_events_url":"https://api.github.com/users/vjkr14/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-09T12:30:40Z","updated_at":"2018-03-14T07:19:43Z","closed_at":null,"author_association":"NONE","body":"I have a Column which used TypeHead of Bootstrap for autocomplete, every thing works perfect, except the edit of same column..\r\n\r\nAfter Edit Button Pressed\r\n![2](https://user-images.githubusercontent.com/4011674/37207592-8c623fde-2395-11e8-848c-1b427a84db41.JPG)\r\nBefore Edit Button Pressed\r\n![1](https://user-images.githubusercontent.com/4011674/37207593-8d47fa10-2395-11e8-9adf-ba031ef7650b.JPG)\r\n\r\nCode of Custom Field\r\n```\r\nvar BSTypeHead = function (config) {\r\n        jsGrid.Field.call(this, config);\r\n    };\r\n    BSTypeHead.prototype = new jsGrid.Field({\r\n        css: \"text-field\",            // redefine general property 'css'\r\n        align: \"left\",              // redefine general property 'align'\r\n        BSTypeHeadControl: \"PropBSTypeHead\",      // custom property\r\n        //sorter: function (date1, date2) {\r\n        //    return new Date(date1) - new Date(date2);\r\n        //},\r\n        itemTemplate: function (value) {\r\n            return value;\r\n        },\r\n        insertTemplate: function (value) {\r\n            return this._editPicker = $(\"<input data-min-length>\").typeahead({\r\n                minLength: 3,\r\n                showHintOnFocus: false,\r\n                source: function (request, response) {\r\n                    jsonObj = [];\r\n                    var valuesData = {};\r\n                    valuesData.SearchTerm = request;\r\n                    //valuesData.UserID = User;\r\n                    jsonObj.push(valuesData);\r\n                    var json = JSON.stringify({ data: jsonObj });\r\n                    $.ajax({\r\n                        url: baseUrl() + '/api/Data/EquipmentSearch/',\r\n                        data: json,\r\n                        dataType: \"json\",\r\n                        type: \"POST\",\r\n                        headers: {\r\n                            'X-XSRF-Token': token\r\n                        },\r\n                        contentType: \"application/json; charset=utf-8\",\r\n                        success: function (data) {\r\n                            items = [];\r\n                            map = {};\r\n                            $.each(data, function (i, item) {\r\n                                var id = item.EQUNR;\r\n                                var name = item.Descr;\r\n                                map[name] = { id: id, name: name };\r\n                                items.push(name);\r\n                            });\r\n                            response(items);\r\n                            $(\".dropdown-menu\").css(\"height\", \"auto\");\r\n                        },\r\n                        error: function (response) {\r\n                            console.log(response.responseText);\r\n                        },\r\n                        failure: function (response) {\r\n                            console.log(response.responseText);\r\n                        }\r\n                    });\r\n                },\r\n                updater: function (item) {\r\n                    //this._editPicker(item);\r\n                    var id = map[item].id;\r\n                    return id;\r\n                }\r\n            });\r\n        },\r\n        editTemplate: function (value) {\r\n            return this._editPicker = $(\"<input data-min-length>\").typeahead({\r\n                minLength: 3,\r\n                showHintOnFocus: false,\r\n                source: function (request, response) {\r\n                    jsonObj = [];\r\n                    var valuesData = {};\r\n                    valuesData.SearchTerm = request;\r\n                    //valuesData.UserID = User;\r\n                    jsonObj.push(valuesData);\r\n                    var json = JSON.stringify({ data: jsonObj });\r\n                    $.ajax({\r\n                        url: baseUrl() + '/api/Data/EquipmentSearch/',\r\n                        data: json,\r\n                        dataType: \"json\",\r\n                        type: \"POST\",\r\n                        headers: {\r\n                            'X-XSRF-Token': token\r\n                        },\r\n                        contentType: \"application/json; charset=utf-8\",\r\n                        success: function (data) {\r\n                            items = [];\r\n                            map = {};\r\n                            $.each(data, function (i, item) {\r\n                                var id = item.EQUNR;\r\n                                var name = item.Descr;\r\n                                map[name] = { id: id, name: name };\r\n                                items.push(name);\r\n                            });\r\n                            response(items);\r\n                            $(\".dropdown-menu\").css(\"height\", \"auto\");\r\n                        },\r\n                        error: function (response) {\r\n                            console.log(response.responseText);\r\n                        },\r\n                        failure: function (response) {\r\n                            console.log(response.responseText);\r\n                        }\r\n                    });\r\n                },\r\n                updater: function (item) {\r\n                    //this._editPicker(item);\r\n                    var id = map[item].id;\r\n                    return id;\r\n                }\r\n            });\r\n        },\r\n        insertValue: function () {\r\n            return this.insertPicker;\r\n        },\r\n        editValue: function () {\r\n            return this._editPicker;\r\n        }\r\n    });\r\n    jsGrid.fields.BSTypeHead = BSTypeHead;\r\n\r\nField Defination: \r\n{\r\n            name: \"EQxxx\", title: 'Equxx', width: 120, type: \"text\", type: \"BSTypeHead\", BSTypeHeadControl: \"PropBSTypeHead\"\r\n        }\r\n\r\n```\r\nRequest Urgent support."},"comment":{"url":"https://api.github.com/repos/tabalinas/jsgrid/issues/comments/372926965","html_url":"https://github.com/tabalinas/jsgrid/issues/1060#issuecomment-372926965","issue_url":"https://api.github.com/repos/tabalinas/jsgrid/issues/1060","id":372926965,"user":{"login":"vjkr14","id":4011674,"avatar_url":"https://avatars2.githubusercontent.com/u/4011674?v=4","gravatar_id":"","url":"https://api.github.com/users/vjkr14","html_url":"https://github.com/vjkr14","followers_url":"https://api.github.com/users/vjkr14/followers","following_url":"https://api.github.com/users/vjkr14/following{/other_user}","gists_url":"https://api.github.com/users/vjkr14/gists{/gist_id}","starred_url":"https://api.github.com/users/vjkr14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjkr14/subscriptions","organizations_url":"https://api.github.com/users/vjkr14/orgs","repos_url":"https://api.github.com/users/vjkr14/repos","events_url":"https://api.github.com/users/vjkr14/events{/privacy}","received_events_url":"https://api.github.com/users/vjkr14/received_events","type":"User","site_admin":false},"created_at":"2018-03-14T07:19:42Z","updated_at":"2018-03-14T07:19:42Z","author_association":"NONE","body":"@heiovsky Formatted the code @tabalinas "}}
{"actor":{"display_login":"vjkr14"}}