1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    46
    Vote Rating
    0
    jsweere is on a distinguished road

      0  

    Default Unanswered: Picker problem

    Unanswered: Picker problem


    On the examples of the picker on this page, the last item of the list cannot be selected. It will bounce up to the 200 KB/s when you attempt to select 300 KB/s. Also, I am having trouble with this component in general. The handlers will not work properly. I copied the example off of the documentation to test and play with it, and I found it was not so usable. Here is what it looked like:

    var picker = Ext.create('Ext.Picker', {
    doneButton: 'Done',
    slots: [
    {
    name : 'limit_speed',
    title: 'Speed',
    data : [
    {text: '50 KB/s', value: 50},
    {text: '100 KB/s', value: 100},
    {text: '200 KB/s', value: 200},
    {text: '300 KB/s', value: 300}
    ]
    }
    ]
    });

    Then I have a button in a panel that has a handler to bring up the picker, and it looks like this:
    xtype: 'button',
    text: 'Color',
    id: 'colorbutton',
    width: getButtonWidthForButtonBoxItems(),
    height: getButtonBoxHeight(),
    handler: function () {
    Ext.Viewport.add(picker);
    picker.show();
    }

    Here is the control I attempted to set up for the Done button:
    Ext.create('Ext.Container', {
    control: {
    'button[text=Done]': {
    tap: 'hideMe'
    }
    },


    hideMe: function() {
    picker.hide();
    }
    });
    I didn't bother to add in the fields that were actually going to be in the picker yet because I wanted to make sure it was the right tool for the job I was doing before fully implementing it.

    Any insight as to whether this is a bug, or just a silly error of my own would be helpful.
    Thanks,
    Joe

  2. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    46
    Vote Rating
    0
    jsweere is on a distinguished road

      0  

    Default Kitchen sink solution

    Kitchen sink solution


    After poking around in the kitchen sink, I noticed that the picker was set up differently, and actually working. So I checked the source on the kitchen sink, plugged in the formatting from it and bingo.

    Here is the format that worked:
    xtype: 'button', text: 'Color',
    id: 'colorbutton',
    width: getButtonWidthForButtonBoxItems(),
    height: getButtonBoxHeight(),
    handler: function () {
    if (!this.colorpicker) {
    this.colorpicker = Ext.Viewport.add({
    xtype: 'picker',
    slots: [
    {
    name : 'limit_speed',
    title: 'Speed',
    data : [
    {text: '50 KB/s', value: 50},
    {text: '100 KB/s', value: 100},
    {text: '200 KB/s', value: 200},
    {text: '300 KB/s', value: 300}
    ]
    }
    ]
    });}


    this.colorpicker.show();
    }

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    46
    Vote Rating
    0
    jsweere is on a distinguished road

      0  

    Default Picker issue: selected item

    Picker issue: selected item


    In the kitchen sink, when you pull up the picker, select an item, and press done, the picker will remember the item you had selected. However, if you open it a second time, select a different item and hit done, it doesn't remember that second choice and pulls up the first choice as the selected item if you open the picker a third time.