v1 QSelect cant change value with object options



  • That arrow function allows QSelect to “dig” into the objects offered in the options array. If you had, say, names for each of the objects, then you could have used name.object-value. But, with just plain objects in the array, QSelect has to map through them. At least that is my novice explanation of what is going on. You’ll see this pattern often, when components need to dig deeper into objects in an array.

    Scott



  • @s-molinari 🤷🏽♂
    But thanks anyway…really appreciate



  • Hi everyone.

    I have been struggling with the simplest q-select for a couple of hours now, trying to select an object form an Array (I am on v.1-beta 15 - tried both Safari and Chrome.

    The example in the docs works in the docs page, but when I put it my project it stops working, although my page contains nothing but the code from the docs. Also, and this is really puzzling, the above codepen by Scott also does not work for me.

    Really scratching my head here.



  • my select
    4713692a-fed3-40be-b087-1d66789d62e9-image.png

    method to create custom object array for select
    78e052ea-2db7-4745-a00e-333dd5ea541c-image.png

    Method for filtering
    6676c6b8-e19e-4e76-b025-13b61e4404e2-image.png

    result
    70661968-fa2f-4ef0-97b1-8b268afb0448-image.png



  • @bruno-ronchetti - Please also upgrade. Beta 15 is awfully old.

    Scott



  • Thanks everyone. I have upgraded to beta 22 and it works now.

    I still need to click twice to get the selection (first click highlights, second selects) - is this the expected behavior?



  • @bruno-ronchetti no it isn’t, better show your q-select definition imo.



  • Thanks for clarifying. I have just checked the browsers:

    • on OSX Chrome I get the selection on first click - version 74.0.3729.131
    • on OSX Safari I need to click twice - version 12.1 (14607.1.40.1.4)

    My q-select is pretty basic:
    <q-select dense bottom-slots stack-label v-model="myDoc.Model" label="Model" :options="modelOptions" class="q-mt-xl" style="max-width: 600px" />



  • This post is deleted!


  • <q-select
    class=“q-mr-xs”
    outlined
    lazy-rules
    label=“Provinsi”
    option-label=“NAMA”
    option-value=“KODE”
    @change=“selectChanges”
    v-model=“form.provinsi”
    :options=“selectOptions”
    :rules="[val => !!val || ‘Select your Provinsi’]"
    />

    <q-input
    class=“q-ml-xs”
    outlined
    v-model=“form.kabkota”
    label=“Kab/Kota”
    lazy-rules
    />

    can someone help me with this??
    i want select bind and change function


Log in to reply