I would like to disable a text input field (edit_line
in Shoes) for user edition(grey field).
I want to have possibility to e.g. set text but I dont want to give that possibility to users.
I checked manual but there's nothing about that edit_line
, only basics.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
As answered in the comments session, to disable edit_line
you need to pass a state
option:
edit_line(state: "disabled")
回答2:
Above answers are perfectly valid! But incase you want to toggle between enabled and disabled state after the edit_line object is created, you can use:
@line = edit_line
@line.state = "disabled" #Disables @line
@line.state = "enabled" #Enables @line back!