Narzędzia użytkownika

Narzędzia witryny


ckeditor

To jest stara wersja strony!


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('Treść maila powiadamiającego');
?>
 
$.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.1705254859.txt.gz · ostatnio zmienione: 2024/09/15 16:22 (edycja zewnętrzna)