We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
先上代码:
$form->switch('custom_position', '自定义位置'); ... $subscriber_script = $this->createSubscriberScript($form, function($builder) { $builder->subscribe('custom_position', 'switchchange', function ($event) { return <<< EOT function (data) { if (data == 'on'){ $('.form-group:last-child').slideDown(); }else{ $('.form-group:last-child').slideUp(); } } EOT; }); }); ...
custom_position 这个switch是默认关闭的, 也就是说 .form-group:last-child 这个元素默认需要调用一次. slideUp()的
custom_position 这个switch是可能是开着可能是关着, .form-group:last-child 这个元素需要根据switch来变化
应该在页面form页面读取完成之后,调用一次subscribe的脚本.
The text was updated successfully, but these errors were encountered:
?
Sorry, something went wrong.
问号的意思是不清楚我的描述吗?假设我初始状态需要隐藏一个text field 直到某个switch为On。在打开这个编辑页面的时候它就应该要判断一次switch的状态是开还是关。
现在的功能只支持当我点击switch的时候 他才能判断on off 来隐藏那个text field
No branches or pull requests
先上代码:
创建的form
custom_position 这个switch是默认关闭的, 也就是说 .form-group:last-child 这个元素默认需要调用一次. slideUp()的
编辑的form
custom_position 这个switch是可能是开着可能是关着, .form-group:last-child 这个元素需要根据switch来变化
猜想的解决方案
应该在页面form页面读取完成之后,调用一次subscribe的脚本.
The text was updated successfully, but these errors were encountered: