How to disable edit_line [closed]

随声附和 提交于 2019-12-11 07:57:22

问题


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!


来源:https://stackoverflow.com/questions/25095586/how-to-disable-edit-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!