I'm attempting to set the Summernote options in Backpack for Laravel 4.1 but nothing happens when I adjust the options.
These are the variations I've tried and they seem to have no affect.
[
'type' => 'summernote',
'name' => 'description',
'options' => [['toolbar', ['font', ['bold', 'underline', 'italic']]]],
'wrapper' => [
'class' => 'form-group col-lg-12',
],
'tab' => $general
]
[
'type' => 'summernote',
'name' => 'description',
'options' => [ ['font', ['bold', 'underline', 'italic']]],
'wrapper' => [
'class' => 'form-group col-lg-12',
],
'tab' => $general
]
[
'type' => 'summernote',
'name' => 'description',
'options' => ['font', ['bold', 'underline', 'italic']],
'wrapper' => [
'class' => 'form-group col-lg-12',
],
'tab' => $general
]
The editor renders, but the editor options remain the same regardless of the options provided.
I think that the error is in the way you provide the options:
'options' => [
'placeholder'=> 'Hello stand alone ui',
'height'=> 120,
'toolbar'=>[
['style', ['style']],
['font', ['bold']], // show only bold button
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture', 'video']],
['view', ['fullscreen', 'codeview', 'help']]
]
for full description of the Summernote see: summernote.org
Related
I want to clone same fields. SO, I am trying to using repeatable type but when I click on add button then no action is performed.
backpack version : 4.1
CRUD::addField([ // Extra Features
'name' => 'clergy_discription',
'label' => 'Extra Features',
'type' => 'repeatable',
'subfields' => [
[
'name' => 'feature',
'wrapper' => [
'class' => 'col-md-3',
],
],
[
'name' => 'quantity',
'type' => 'number',
'wrapper' => [
'class' => 'col-md-3',
],
],
],
]);
I want to add spinner to select list using ajax. I have tried below code for throbber but it's not working for select list.
$form['select choice'] = [
'#type' => 'select',
'#title' => t('Choice'),
'#attributes' => [
'class' => ['js-dop-chosen'],
],
'#options' => [
'---' => t('None'),
t('choice 1'),
t('choice 2'),
],
'#ajax' => [
'event' => 'change',
'wrapper' => 'form-wrapper',
'callback' => [$this, 'ajaxCallback'],
'progress' => [
'type' => 'throbber',
'message' => 'fetching content.....',
],
],
];
I have this code:
Controller
$this->crud->addField(
[
'name' => 'schedule',
'label' => 'Schedule',
'type' => 'repeatable',
'fields' => [
[
'name' => 'day',
'label' => 'Day',
'type' => 'select_from_array',
'options' => Day::titles(),
'allows_null' => false,
],
[
'name' => 'range',
'label' => 'Range',
'type' => 'select2_from_array',
'options' => $this->getScheduleRange(),
'default' => $this->getDefaultScheduleRange(),
'allows_null' => false,
"allows_multiple" => true,
],
],
]
);
Model
protected $casts = [
'schedule' => 'array',
];
stored data in DB(schedule column):
[{"day": "1", "range[]": ["1:30:00", "2:00:00"]}]
But selected data not showing on the page when it is multi selected.
UPD:
After Pedro's recomandation it's not help me. In DB it's storing as:
[{"day": "1", "range[]": ["0", "1"]}]
viper.
when using multiple with default please use numeric keys like:
'options' => [0 => 'option 0', 1 => 'option 1'],
'default' => [0,1]
I think Backpack can do something here to improve multiple string keys like
'options' => ['option_0', 'option_1'],
'default' => ['option_0', 'option_1']
I will open an issue to discuss this in the package repository.
Thanks
Pedro
How to add title when exporting to excel in Laravel using Yajra?
->parameters([
'dom' => 'Bfrtip',
'order' => [[4, "desc"]],
//'buttons' => ['excel', 'pdf', 'print'],
'buttons' => [
[
'extend' => 'excel',
'title' => "adjfadfjad"
],
[
'extend' => 'pdf'
],
[
'extend' => 'print',
'title' => "adjfadfjad"
],
],
]);
I tried adding title but it's failed, not working, how to solve that?
Add like this: title or message on top:
->parameters([
dom => 'Bfrtip',
'order' => [[4, "desc"]],
'buttons' => [
{
extend: 'excel',
messageTop: 'Title Information'}
],
]);
I need to apply my spanish analyzer to a object type parameter, but it returns error. How could i do i apply it? Inside that field are an array of JSON Objects.
Thanks!
$params = [
'index' => 'cl',
'body' => [
'analysis' => [
'analyzer' => [
'spanish' => [
'type' => 'custom',
'tokenizer' => 'standard',
'filter' => ['lowercase', 'asciifolding', 'spanish_stop', 'spanish_stemmer']
]
],
'filter' => [
'spanish_stemmer' => [
'type' => 'stemmer',
'name' => 'spanish'
],
'spanish_stop' => [
'type' => 'stop',
'stopwords' => ['_spanish_', 'del', 'de', 'el', 'ella', 'los', 'los', 'las', 'la', 'a', 'un', 'y']
]
]
],
'mappings' => [
'people' => [
'_all' => ['enabled' => true],
'properties' => [
'user_info' => ['type' => 'text', 'analyzer' => 'spanish', 'search_analyzer' => 'spanish'],
'resumes' => ['type' => 'object', 'analyzer' => 'spanish', 'search_analyzer' => 'spanish'],
'resume_details' => ['type' => 'object', 'analyzer' => 'spanish', 'search_analyzer' => 'spanish'],
'applications' => ['type' => 'object', 'analyzer' => 'spanish', 'search_analyzer' => 'spanish'],
],
],
],
]
];