Results 1 to 6 of 6

Thread: Ext.view.MultiSelectorView - How to select all?

  1. #1
    Sencha Premium Member
    Join Date
    May 2015
    Posts
    24
    Answers
    3

    Default Answered: Ext.view.MultiSelectorView - How to select all?

    I am have a "Select All" button under the tbar in the multiSelector. I found there is no method to set selection on the search list.

    untitled.png

  2. Quote Originally Posted by joeywong View Post
    I am have a "Select All" button under the tbar in the multiSelector. I found there is no method to set selection on the search list.
    In the handler for your buttons, you can do something like this:

    Code:
    handler: function(btn, e, eOpts) {
        var selector = btn.up('multiselector-search'),
            store = selector.getSearchStore();
        selector.selectRecords(store.getRange())
        // selector.deselectRecords() for deselection...
    }
    I've included an example below.

    Thanks!
    Joel


  3. #2
    Sencha User
    Join Date
    Mar 2009
    Location
    München
    Posts
    574
    Answers
    99

    Default

    Where is the code?Where have you found 'Ext.view.MultiSelectorView' class?

  4. #3
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Quote Originally Posted by joeywong View Post
    I am have a "Select All" button under the tbar in the multiSelector. I found there is no method to set selection on the search list.
    In the handler for your buttons, you can do something like this:

    Code:
    handler: function(btn, e, eOpts) {
        var selector = btn.up('multiselector-search'),
            store = selector.getSearchStore();
        selector.selectRecords(store.getRange())
        // selector.deselectRecords() for deselection...
    }
    I've included an example below.

    Thanks!
    Joel


  5. #4
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Quote Originally Posted by yeghikyan View Post
    Where is the code?Where have you found 'Ext.view.MultiSelectorView' class?
    I assume the reference is to this: http://docs.sencha.com/extjs/6.0/6.0....MultiSelector

  6. #5
    Sencha Premium Member
    Join Date
    May 2015
    Posts
    24
    Answers
    3

    Default

    in select all function, the selected list in a reversed order. need to change it as below:
    selector.selectRecords(store.getRange().reverse());

  7. #6
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    321
    Answers
    5

    Default

    Maybe you need to create the multiselector-search view first. If no, you will have some error message if you want to access it.
    See these lines of code in https://fiddle.sencha.com/#view/editor&fiddle/2cpu :

    Code:
    var plus = form.down('multiselector').tools[0];
    //Fire click event of plus button for creating search view
    plus.el.dom.click();
    //Hide the multiselector-search
    form.down('multiselector-search').hide();

Similar Threads

  1. changing the view from a select form
    By lucaiuli in forum Ext: Q&A
    Replies: 3
    Last Post: 14 Feb 2013, 6:03 AM
  2. Select a node in a tree view
    By ahsec in forum Ext: Q&A
    Replies: 3
    Last Post: 19 Nov 2012, 6:45 AM
  3. Replies: 1
    Last Post: 1 Sep 2012, 3:29 PM
  4. Replies: 1
    Last Post: 17 Jan 2012, 8:54 AM
  5. List View Select Issue
    By rupesh.patayane in forum Ext GWT: Discussion
    Replies: 4
    Last Post: 11 May 2010, 1:55 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
  •