Skip to content

对关联属性,编辑器不起作用 #5

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

Open
YIFANXIAO opened this issue Mar 29, 2020 · 4 comments
Open

对关联属性,编辑器不起作用 #5

YIFANXIAO opened this issue Mar 29, 2020 · 4 comments
Labels
bug Something isn't working fixed

Comments

@YIFANXIAO
Copy link

两个model的关系是一对一,在form表单中希望用$form->editormd('articleContent.content');添加编辑器,但是不起作用,界面上的效果是这样的
image
更换属性后,编辑器显示正常
$form->editormd('intro');
image
是目前还不支持关联属性吗

@ShermanTsang
Copy link
Owner

是的 目前还不支持关联属性,过段时间我更新一下添加上该功能。
谢谢你的反馈!

@phpervip
Copy link

期待作者更新,很需要关联属性啊。

@phpervip
Copy link

与作者联系后,作者说近日会更新。
后来我改了几处,竟然可以了。请作者看看,可否?
editor.blade.php中,第11行,name改为id

<div id="{{$id}}">
            <textarea {!! $attributes !!} style="display:none;">{{ old($column, $value) }}</textarea>
        </div>

Editor.php中,第19行,加一行:
$name = $this->formatName($this->column);
第35,37,53,55行,$this->id改为$name

if( config['saveHTMLToTextarea'] ) {
                $(".editormd-html-textarea").attr("name", '{$name}');
            } else {
                $(".editormd-markdown-textarea").attr("name", '{$name}');
            }

@ShermanTsang
Copy link
Owner

与作者联系后,作者说近日会更新。
后来我改了几处,竟然可以了。请作者看看,可否?
editor.blade.php中,第11行,name改为id

<div id="{{$id}}">
            <textarea {!! $attributes !!} style="display:none;">{{ old($column, $value) }}</textarea>
        </div>

Editor.php中,第19行,加一行:
$name = $this->formatName($this->column);
第35,37,53,55行,$this->id改为$name

if( config['saveHTMLToTextarea'] ) {
                $(".editormd-html-textarea").attr("name", '{$name}');
            } else {
                $(".editormd-markdown-textarea").attr("name", '{$name}');
            }

你好,你的思路是正确的。
刚才发布了新版本已经支持关联属性使用编辑器了!
注意版本是 v1.1 。
composer require sharemant/laravel-admin-ext-editormd:^1.1

@ShermanTsang ShermanTsang added bug Something isn't working fixed labels Jul 18, 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 fixed
Projects
None yet
Development

No branches or pull requests

3 participants