Closed fouedmoussi closed 5 years ago
Thanks for bringing this to my attention! Apparently the displayUsingLabels()
method didn't work out of the box with vue-single-select so I fixed it in v1.1.1
I have made a fresh install of your package and still getting this error. I am on version v1.2.3
Hmm, what does your JSON look like?
For example:
{
"component": "select-auto-complete",
"prefixComponent": true,
"indexName": "Darstellung (View)",
"name": "Darstellung (View)",
"attribute": "view_type",
"value": "list_teaser",
"panel": null,
"sortable": false,
"nullable": false,
"readonly": false,
"required": false,
"textAlign": "left",
"sortableUriKey": "view_type",
"stacked": false,
"bmdevClasses": {
"editContainer": "w-1\/3"
},
"maxResults": 30,
"maxHeight": "220px",
"options": [{
"label": "List Teaser",
"value": "list_teaser"
}, {
"label": "List Teaser Klein",
"value": "list_teaser_small"
}, {
"label": "Bilder-Raster",
"value": "linked_img"
}, {
"label": "Titled Bottom",
"value": "titled_bottom"
}, {
"label": "Teasered Bottom",
"value": "teasered_bottom"
}],
"default": "list_teaser"
}
Getting this result:
Btw. since I am using multiple selectboxes, I also get an warning in the console:
Thanks for the JSON :)
So if I understand you correctly you want to display it only with labels and have used the displayUsingLabels
option which should only display labels but it doesn't?
Regarding the same id
s I'm not sure as to why it does that since if you look in resources/js/components/Form/index.vue on line 4 it clearly sets the id
dynamically. Weird.
Oh. Didn't get the displayUsingLabels
method, since I thought showing the label for the label would be the default behavior :D.
Thank you for your help!
Hehe, you are correct it is a bit vaguely documented. I will update the README to make it more visible.
SelectAutoComplete::make('Origin market', 'origin_market') ->options(collect($mergedMarketsOptions)->mapWithKeys(function ($option) { return [$option['code'] => $option['name']]; }))->default(["value" => $this->origin_market])->displayUsingLabels()->hideFromIndex(),
Is it possible to hide option values referred to
$option['code']
in the above code ?