ckeditor
To jest stara wersja strony!
Spis treści
Usunięcie odległości miedzy akapitami
$this->registerJs(" CKEDITOR.addCss('.cke_editable p { margin: 0 !important; } body{line-height: normal !important;}'); ");
Pole formularza
$form->field($model, 'opis')->widget(CKEditor::className(), [ 'preset' => 'full', 'clientOptions' => [ 'extraPlugins' => 'justify', 'skin' => 'kama', 'height'=>200 ] ])->label('Opis');
Ładowanie ajaxem treści do edytora
model: GrupyStudentowZapisy
<?= $form->field($model, 'mail')->widget(CKEditor::className(), [ 'preset' => 'standard', 'clientOptions' => [ 'extraPlugins' => 'justify', 'height' => '200', 'skin' => 'kama' ] ])->label('Treść maila powiadamiającego'); ?> <?= $form->field($model, 'opis')->widget(CKEditor::className(), [ 'preset' => 'standard', 'clientOptions' => [ 'extraPlugins' => 'justify', 'height' => '200', 'skin' => 'kama' ] ])->label('Opis'); ?> $.ajax({ url: '/grzapisy/zestawy/dane?id=' + $(this).val(), type: 'GET', dataType: 'json', success: function (data) { var editor_m = CKEDITOR.instances['grupystudentowzapisy-mail']; var editor_o = CKEDITOR.instances['grupystudentowzapisy-opis']; editor_m.setData(data.mail); editor_o.setData(data.opis); }, error: function () { console.error('Wystąpił błąd podczas pobierania danych.'); } });
ckeditor.1705254905.txt.gz · ostatnio zmienione: 2024/09/15 16:22 (edycja zewnętrzna)