1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    joesinla is on a distinguished road

      0  

    Default PIcker selection functionality

    PIcker selection functionality


    I'm creating a custom picker that dynamically loads data to three slots. Each slot requires the selection of the preceding slot. This works great by actually tapping on the item in the slot, however the problem is when sliding or rolling the selection without actually tapping it will not select the item. Is there a way to have a picker slot load a selection wether or not you actually 'tap' the item?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,728
    Vote Rating
    752
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So you want to programmatically select a value in a slot?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    joesinla is on a distinguished road

      0  

    Default


    No. What I mean is when using the Picker you it will only select the selection if the selection is actually tapped on in the slot. If the user tries to just slide using vertical swipe, the selection, even though highlighted, is not selected. Most users just slide the slot and don't tap the slot selection. I hope that makes more sense. Thank you kindly for your help!

  4. #4
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    71
    Vote Rating
    6
    cyee is on a distinguished road

      0  

    Default


    You could try listening for the dragend event on the slot div.

    Code:
    var myPicker = Ext.ComponentQuery.query('mypicker');
    var slot = myPicker.down('#slotID');
    var el = slot.element;
    
    var onDragend = function(...) {
    ...
    };
    
    el.addListener('dragend', onDragend);

  5. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    joesinla is on a distinguished road

      0  

    Default


    Beautiful! That makes total sense. I'll try that...

  6. #6
    Sencha User
    Join Date
    Oct 2012
    Posts
    10
    Vote Rating
    0
    simsimmal is on a distinguished road

      0  

    Default


    Hello, i'am trying to programmatically select a value in a slot? Seems i'am missing something in the docs. Please give me a hint.

  7. #7
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    joesinla is on a distinguished road

      0  

    Default


    Quote Originally Posted by simsimmal View Post
    Hello, i'am trying to programmatically select a value in a slot? Seems i'am missing something in the docs. Please give me a hint.
    Good question, I'm not sure about that. I looked that up too and didn't see anyway to set the picker or picker slot selection. Please post back if you find an answer to that.

  8. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,728
    Vote Rating
    752
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by simsimmal View Post
    Hello, i'am trying to programmatically select a value in a slot? Seems i'am missing something in the docs. Please give me a hint.
    Here is an example (code in red is the important snippet):

    Code:
    var picker = Ext.create('Ext.picker.Picker', {
        slots : [
            {
                name  : 'speed',
                title : 'Speed',
                data  : [
                    { text : '50',  value : 50  },
                    { text : '100', value : 100 },
                    { text : '200', value : 200 },
                    { text : '300', value : 300 }
                ]
            },
            {
                name  : 'unit',
                title : 'Unit',
                data  : [
                    { text : 'KB/s', value : 'kbps' },
                    { text : 'MB/s', value : 'mbps' }
                ]
            }
        ]
    });
    
    picker.setValue({
        speed : 200,
        unit  : 'mbps'
    });
    
    Ext.Viewport.add(picker);
    picker.show();
    The setValue takes an object with the property being the name of the slot and the value being the value of the slot.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  9. #9
    Sencha User
    Join Date
    Oct 2012
    Posts
    10
    Vote Rating
    0
    simsimmal is on a distinguished road

      0  

    Default


    so obvious,

    thanks a lot!

Thread Participants: 3

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar