Results 1 to 4 of 4

Thread: How to bind multiselectfield in Modern 6.5.2 Triton

  1. #1
    Sencha User
    Join Date
    Sep 2018
    Posts
    6

    Default How to bind multiselectfield in Modern 6.5.2 Triton

    I'm trying to simulate in modern toolkit 6.5.2 the **tagfield** that existed in classic toolkit, I found two ways to do it :


    https://github.com/facilitiesexchange/TagField/


    AND


    https://stackoverflow.com/questions/...tiselect-field


    I used both in this way :


    Code:
       {
            xtype:'multiselectfield', //tagfield
            multiSelect: true,
            displayField: 'name',
            required: true,
            store: [
                { name: 'Peter',  age: 26 },
                { name: 'Ray',   age: 21 },
                { name: 'Egon', age: 24 },
                { name: 'Winston', age: 24 }
             ],
            label : 'People'
        }
    The first custom-field worked for displaying the data from my store but I didn't get binding the selected values, and when I tried to use the value property, the store didn't shown at all.


    The second throwed some errors and when a fixed them It didn't displayed any values from my store at all, so I didn't have the chance to bind the selected values.
    I tried adding the code below to TagField:


    Code:
       xvalue: null,
      defaultBindProperty: 'xvalue',
      publishes: 'xvalue',
    ...
    applyStore: function(store) {
        if (store) {
          store = Ext.data.StoreManager.lookup(store);
        }
        return store;
      },
      updateStore: function(store, oldStore) {
        if (oldStore) {
          if (oldStore.getAutoDestroy()) {
            oldStore.destroy();
          }
        }
      },
    but didnt work.


    So I would like to know how to bind the selected values in a multiselectfield with my viewModel.


    Here is my fiddle: https://fiddle.sencha.com/#view/editor&fiddle/2lf0

    Thanks

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Thank you for all the information- this is very helpful in us figuring this out in a timely manner. I have sent this to the support team and they will look into this at their earliest convenience. We appreciate your patience!

    Michele

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    45
    Answers
    1

    Default

    Quote Originally Posted by LuciaT View Post
    I'm trying to simulate in modern toolkit 6.5.2 the **tagfield** that existed in classic toolkit, I found two ways to do it :


    https://github.com/facilitiesexchange/TagField/


    AND


    https://stackoverflow.com/questions/...tiselect-field


    I used both in this way :


    Code:
       {
            xtype:'multiselectfield', //tagfield
            multiSelect: true,
            displayField: 'name',
            required: true,
            store: [
                { name: 'Peter',  age: 26 },
                { name: 'Ray',   age: 21 },
                { name: 'Egon', age: 24 },
                { name: 'Winston', age: 24 }
             ],
            label : 'People'
        }
    The first custom-field worked for displaying the data from my store but I didn't get binding the selected values, and when I tried to use the value property, the store didn't shown at all.


    The second throwed some errors and when a fixed them It didn't displayed any values from my store at all, so I didn't have the chance to bind the selected values.
    I tried adding the code below to TagField:


    Code:
       xvalue: null,
      defaultBindProperty: 'xvalue',
      publishes: 'xvalue',
    ...
    applyStore: function(store) {
        if (store) {
          store = Ext.data.StoreManager.lookup(store);
        }
        return store;
      },
      updateStore: function(store, oldStore) {
        if (oldStore) {
          if (oldStore.getAutoDestroy()) {
            oldStore.destroy();
          }
        }
      },
    but didnt work.


    So I would like to know how to bind the selected values in a multiselectfield with my viewModel.


    Here is my fiddle: https://fiddle.sencha.com/#view/editor&fiddle/2lf0

    Thanks
    I have tested your fiddle it works display combobox with multi select, so your problem you can't get value of multi select when your submit form?(the value via viewmodel record)

  4. #4
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    542
    Answers
    7

    Default

    Hello,

    I have created fiddle Hope this will help to select multiple value with viewModel bind


    https://fiddle.sencha.com/#view/editor&fiddle/2tau


    Regards,
    Kumar
    Sencha Support.

Similar Threads

  1. [OPEN] Modern 6.6.0 Triton Theme Trigger containing Component Width
    By MikeLowery in forum Ext JS 6.x Bugs
    Replies: 2
    Last Post: 23 Sep 2018, 4:40 AM
  2. modern bind selectfield
    By juj21067 in forum Ext JS 6.x Q&A
    Replies: 0
    Last Post: 10 Jul 2016, 5:00 PM
  3. sencha modern bind constructor
    By juj21067 in forum Ext JS 6.x Q&A
    Replies: 1
    Last Post: 4 Jul 2016, 10:18 PM
  4. Replies: 1
    Last Post: 15 Dec 2015, 11:57 AM
  5. Confused about modern Triton x-big and devices
    By estesbubba in forum Ext JS 6.x Q&A
    Replies: 0
    Last Post: 27 Oct 2015, 6:45 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •