No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Editing the selected option in the select dropdown

    Help
    2
    2
    2290
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Swathi.S last edited by Swathi.S

      Hi,I am trying the edit the previously selected option in the select drop down.I am able to show the checked options based on the data driven from the service call, but not able to choose other select option in the drop down.
      Code:

      <q-select
       multiple 
      stack-label="Actions"
      v-model="multiSelect"
      :options="options"/>
      

      Script:

      import {QCheckbox,QSelect} from 'quasar'export
       default {components: {QCheckbox,QSelect},
      data () {return {
      multSelect: [],
      options1: [{label: 'X-B',value: 'x-b'},{label: 'RT-Builder',value: 'rt-builder'},{label: 'Com',value: 'com'},{label: 'Max',value: 'max'},{label: 'Runner',value: 'runner'},{label: 'Opto',value: 'opto'}],
      ....................
      created () {
      axios.get('http://*********/getDetails').then(response => {
      this.multiSelect = response.data
      })
      }
      

      Can someone help me with this?

      1 Reply Last reply Reply Quote 1
      • Frosty-Z
        Frosty-Z last edited by

        The value you store in your component property multiSelect should be an array of the selectable values you want to be checked:

        For example (following your data set):

        this.multiSelect = ['x-b', 'rt-builder', 'max']
        

        Whereas for “simple” select fields (single choice)

        <q-select ... v-model="selectedValue" :options="options" />
        

        you simply do

        this.selectedValue = 'identifier'
        

        Answered here too:
        https://stackoverflow.com/questions/47035330/editing-the-selected-option-in-the-select-dropdownq-select-of-quasar-framewor/48227687#48227687

        1 Reply Last reply Reply Quote 1
        • First post
          Last post