Skip to content
New issue

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表单select联动更新问题 #237

Closed
QThans opened this issue Jun 19, 2020 · 15 comments
Closed

Form表单select联动更新问题 #237

QThans opened this issue Jun 19, 2020 · 15 comments
Labels
bug Something isn't working

Comments

@QThans
Copy link

QThans commented Jun 19, 2020

1.5的版本以后:form的select组件的load 函数,$class = static::FIELD_CLASS_PREFIX.$field;,class的获取改成这个,导致之前不兼容。新的按照文档的格式也无法加载。

@QThans
Copy link
Author

QThans commented Jun 19, 2020

我看这边增加了一个常量用来给class增加上field,但是select渲染以后并没有给class加上field,input输入框貌似是有的。

@jqhph
Copy link
Owner

jqhph commented Jun 19, 2020

1.5表单联动我是测试过正常的,正常升级不会不兼容啊

@QThans
Copy link
Author

QThans commented Jun 19, 2020

 $table->select('type', '事件类型')->options(FormEvent::EVENT_TYPE)->load('name', route('bpm.formEvents'));
$table->select('name', '事件名称')->addElementClass('field_name');

上面这样写是OK的。

$table->select('type', '事件类型')->options(FormEvent::EVENT_TYPE)->load('name', route('bpm.formEvents'));
$table->select('name', '事件名称');

这样是没有联动的。

生成代码如下:
js部分
image

html部分
image

@jqhph
Copy link
Owner

jqhph commented Jun 20, 2020

好的,我晚上试试,如果有问题会在明天晚上的小版本中修复

@jqhph
Copy link
Owner

jqhph commented Jun 20, 2020

你确定你是1.5.0版本的吗?我测试了下联动功能正常

 $form->select('author_id')->options(['GET', 'POST', 'PUT'])->load('state', 'test/options');
$form->select('state');

image

@QThans
Copy link
Author

QThans commented Jun 20, 2020

是的 我晚上移除包,重新安装再试下。

@jqhph
Copy link
Owner

jqhph commented Jun 20, 2020

你应该是没有重新发布资源或者是没有清理浏览器缓存吧,看你这个html也有问题

@QThans
Copy link
Author

QThans commented Jun 20, 2020

还是不行 重新装了下。php artisan admin:publish --force 这个已经运行很多次了。

@jqhph
Copy link
Owner

jqhph commented Jun 20, 2020

截图下你的完整form表单代码

@QThans
Copy link
Author

QThans commented Jun 20, 2020

image

@jqhph jqhph added the bug Something isn't working label Jun 20, 2020
@jqhph
Copy link
Owner

jqhph commented Jun 20, 2020

感谢反馈,在table表单下确实有问题

@jqhph jqhph closed this as completed in bc0f0cc Jun 20, 2020
@jqhph
Copy link
Owner

jqhph commented Jun 20, 2020

已修复,等明天新版本吧

@QThans
Copy link
Author

QThans commented Jun 20, 2020

另外建议select的default在未选中的时候可以被提交。上一个版本好像可以?昨晚更新以后貌似不行了。不确定。没影响是个我这边还没开发好的功能出现的。

@jqhph
Copy link
Owner

jqhph commented Jun 20, 2020

default方法编辑页面是不生效的,如果编辑页面需要,请用customFormat方法代替

@QThans
Copy link
Author

QThans commented Jun 20, 2020

谢谢!产品很棒!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants