{"action":"created","issue":{"url":"https://api.github.com/repos/selectize/selectize.js/issues/1224","repository_url":"https://api.github.com/repos/selectize/selectize.js","labels_url":"https://api.github.com/repos/selectize/selectize.js/issues/1224/labels{/name}","comments_url":"https://api.github.com/repos/selectize/selectize.js/issues/1224/comments","events_url":"https://api.github.com/repos/selectize/selectize.js/issues/1224/events","html_url":"https://github.com/selectize/selectize.js/issues/1224","id":196390491,"number":1224,"title":"Selected saved value on edit form","user":{"login":"TDK1964","id":1914368,"avatar_url":"https://avatars.githubusercontent.com/u/1914368?v=3","gravatar_id":"","url":"https://api.github.com/users/TDK1964","html_url":"https://github.com/TDK1964","followers_url":"https://api.github.com/users/TDK1964/followers","following_url":"https://api.github.com/users/TDK1964/following{/other_user}","gists_url":"https://api.github.com/users/TDK1964/gists{/gist_id}","starred_url":"https://api.github.com/users/TDK1964/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TDK1964/subscriptions","organizations_url":"https://api.github.com/users/TDK1964/orgs","repos_url":"https://api.github.com/users/TDK1964/repos","events_url":"https://api.github.com/users/TDK1964/events{/privacy}","received_events_url":"https://api.github.com/users/TDK1964/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-19T11:23:27Z","updated_at":"2016-12-22T20:04:03Z","closed_at":null,"body":"I did:\r\n\r\n* [x] Search for if my issue has already been submitted\r\n* [x] Make sure I'm reporting something precise that needs to be fixed\r\n* [x] Give my issue a descriptive and concise title\r\n* [x] Create a *minimal* working example on JsFiddle or Codepen\r\n\t(or gave a link to a demo on the Selectize docs)\r\n* [x] Indicate *precise* steps to reproduce in *numbers* and the result,\r\n\t  like below\r\n\r\n[Selected saved value on edit form]\r\n\r\nSteps to reproduce:\r\n\r\n1. Open and save form in create mode\r\n2. Load form in edit mode\r\n3. Previously save selected value is displaying the \"id\" value and not the \"name\" \r\n\r\nExpected result:\r\nSelectize DDL should show the text and not the id\r\n\r\nActual result:\r\nShows the Id\r\n\r\n```\r\n    $('#RaisedById').selectize({\r\n        persist: false,\r\n        valueField: 'Id',\r\n        labelField: 'Name',\r\n        searchField: 'Name',\r\n        options: [],\r\n        create: false,\r\n        preload: true,\r\n        maxItems: 1,\r\n        load: function(query, callback) {\r\n            var self = this;\r\n            $.ajax({\r\n                url: '/SelectHelper/GetUserList',\r\n                type: 'GET',\r\n                dataType: 'json',\r\n                data: { q: query },\r\n                error: function() { callback(); },\r\n                success: function(res) {\r\n                    callback(res);\r\n                }\r\n            }).then(function() {\r\n                console.log(\"then\");\r\n            }).done(function() {\r\n                console.log(\"done\");\r\n                var val = parseInt(self.items[0]);\r\n                self.setValue(val);\r\n            });\r\n        }\r\n    });\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/selectize/selectize.js/issues/comments/268879388","html_url":"https://github.com/selectize/selectize.js/issues/1224#issuecomment-268879388","issue_url":"https://api.github.com/repos/selectize/selectize.js/issues/1224","id":268879388,"user":{"login":"TDK1964","id":1914368,"avatar_url":"https://avatars.githubusercontent.com/u/1914368?v=3","gravatar_id":"","url":"https://api.github.com/users/TDK1964","html_url":"https://github.com/TDK1964","followers_url":"https://api.github.com/users/TDK1964/followers","following_url":"https://api.github.com/users/TDK1964/following{/other_user}","gists_url":"https://api.github.com/users/TDK1964/gists{/gist_id}","starred_url":"https://api.github.com/users/TDK1964/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TDK1964/subscriptions","organizations_url":"https://api.github.com/users/TDK1964/orgs","repos_url":"https://api.github.com/users/TDK1964/repos","events_url":"https://api.github.com/users/TDK1964/events{/privacy}","received_events_url":"https://api.github.com/users/TDK1964/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T20:04:03Z","updated_at":"2016-12-22T20:04:03Z","body":"Unfortunately not, it's all local development work. However, using the example above, RaisedById will be populated from the database with an FK integer ID. This ID is the PK from another table."}}
{"actor":{"display_login":"TDK1964"}}