{"action":"created","issue":{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/412","labels_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/412/labels{/name}","comments_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/412/comments","events_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/412/events","html_url":"https://github.com/wenzhixin/bootstrap-table/issues/412","id":53885607,"number":412,"title":"editable table option or any other option changing with button","user":{"login":"omatic-hacker","id":3194626,"avatar_url":"https://avatars.githubusercontent.com/u/3194626?v=3","gravatar_id":"","url":"https://api.github.com/users/omatic-hacker","html_url":"https://github.com/omatic-hacker","followers_url":"https://api.github.com/users/omatic-hacker/followers","following_url":"https://api.github.com/users/omatic-hacker/following{/other_user}","gists_url":"https://api.github.com/users/omatic-hacker/gists{/gist_id}","starred_url":"https://api.github.com/users/omatic-hacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omatic-hacker/subscriptions","organizations_url":"https://api.github.com/users/omatic-hacker/orgs","repos_url":"https://api.github.com/users/omatic-hacker/repos","events_url":"https://api.github.com/users/omatic-hacker/events{/privacy}","received_events_url":"https://api.github.com/users/omatic-hacker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/labels/extension","name":"extension","color":"005299"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-09T16:26:22Z","updated_at":"2015-07-16T14:19:16Z","closed_at":"2015-07-16T14:19:16Z","body":"Hello,\r\n\r\nhow can i change editable mode with button? Or any other table option \"on a fly\".\r\nI included bootstrap-editable and bootstrap-table-editable. Everything is ok when i create table with {editable: true}.\r\n\r\nBut what if I want to change editable mode with button in toolbar? Can I do that?\r\n\r\nI supposed i can do it with tablename.bootstrapTable({editable.false}); and then some how refresh it?\r\n\r\nI found one method. But I think it's kind a creepy way;)\r\n\r\nBy default table is created with editable true. I want to disable it with button, so on click:\r\n1. tablename.bootstrapTable('destroy');\r\n2. Changing var TABLE_EDITABLE = true;\r\n3. iptable.bootstrapTable({editable: TABLE_EDITABLE});\r\n\r\nAnd new table is displayed.\r\n\r\n\r\nSo is this right? It's ok for edit mode, but if I want to change only cellStyle or rowStyle, is it good to rebuild all ?\r\n"},"comment":{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/comments/121969988","html_url":"https://github.com/wenzhixin/bootstrap-table/issues/412#issuecomment-121969988","issue_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/412","id":121969988,"user":{"login":"wenzhixin","id":2117018,"avatar_url":"https://avatars.githubusercontent.com/u/2117018?v=3","gravatar_id":"","url":"https://api.github.com/users/wenzhixin","html_url":"https://github.com/wenzhixin","followers_url":"https://api.github.com/users/wenzhixin/followers","following_url":"https://api.github.com/users/wenzhixin/following{/other_user}","gists_url":"https://api.github.com/users/wenzhixin/gists{/gist_id}","starred_url":"https://api.github.com/users/wenzhixin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenzhixin/subscriptions","organizations_url":"https://api.github.com/users/wenzhixin/orgs","repos_url":"https://api.github.com/users/wenzhixin/repos","events_url":"https://api.github.com/users/wenzhixin/events{/privacy}","received_events_url":"https://api.github.com/users/wenzhixin/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T14:19:16Z","updated_at":"2015-07-16T14:19:16Z","body":"Found a work around to solve your problem:\r\n```\r\n// disable row 2\r\n$('tr[data-index=\"2\"]').find('.editable').editable('disable');\r\n\r\n// disable row 2, name field.\r\n$('tr[data-index=\"2\"]').find('.editable[data-name=\"name\"]').editable('disable')\r\n```"}}