Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Combobox list item keep marking on last selected item

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1

    Default Combobox list item keep marking on last selected item

    Hi,

    I'm working on Sencha Touch 2.3.
    I have same many comboboxes using same store. And i have problem using them.

    I selected an item for the combo_1.
    I click on the combo_2 then it display same list of items as comb_1.
    But the selected item on combo_1 is already marked on this list.
    So i can not select it again. I have to select another item, then click again and select the good item.

    I'm appreciated you reply! Thank you !

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Try using a store alias. When you define the store, you can give it an alias of store.storealias (where storealias is your chosen alias name).
    Code:
    Ext.define('MyApp.store.MyStore', {
        extend: 'Ext.data.Store',
        storeId: 'MyStore',
        alias: 'store.mystore',
        fields: ['foo', 'bar']
    });
    When you attach your store to your component, youre actually attaching a new instance of the store and your components can remain separate.
    Code:
    store: {
        type: 'mystore'
    }
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

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

    Need to include a test case use:
    The official Sencha Fiddle

  3. #3

    Default

    I've never used store alias before.
    If i have many instance for the store, i will need to load data for each.
    In this case, the store is used in many place. I think i will load data a lot of time.

    I have just found an other case for this problem.
    If i select a value for a combobox. Then i programmatically set null for the combo value.
    And when i click on the combobox, it show a list of item. But the last selected item is marked.
    So i can not select this item again. I need to select another then reselect the that item.

    That's weird.
    I think when we click on combox, Sencha should show the item list. But it should not mark the last selected item. And just mark the item being selected.

  4. #4

    Default

    Somebody help me !

  5. #5
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    On second thought might not be an issue with store. How are you defining selectfields on your form?
    This new issue with clearing the selectfield sounds like, TOUCH-5078, a bug that has been fixed in Touch 2.3.2. Have you tried using selectfield.reset(). What is the exact version of Touch you are using?
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

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

    Need to include a test case use:
    The official Sencha Fiddle

  6. #6

    Default

    Quote Originally Posted by fmoseley View Post
    On second thought might not be an issue with store. How are you defining selectfields on your form?
    This new issue with clearing the selectfield sounds like, TOUCH-5078, a bug that has been fixed in Touch 2.3.2. Have you tried using selectfield.reset(). What is the exact version of Touch you are using?
    Hi sorry for my very very late reply.
    After try some way, the problem is still not fixed.
    So i lived with it in 4 years, on my application.

    But now i really want to fix it again.
    I'm using Sencha Touch 2.3.0.

    I tried your suggestion, but selectfield.reset() actually select the first record on the list. Which i don't want to also.
    Thank you for your time !

  7. #7
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Have you tried testing with the most recent version (2.4.2) to see if the bug is resolved?

  8. #8

    Default

    Quote Originally Posted by Gary Schlosberg View Post
    Have you tried testing with the most recent version (2.4.2) to see if the bug is resolved?
    I didn't but i'm worry if i change the version there will be some other bugs.
    Can you help me to solve problem on this version ?

  9. #9

    Default

    I have just tried the 2.4.2 it doesn't fix this problem.
    But luckily it fixed another problem, that i posted in another thread: Can not swipe down the ListView on Chrome for PC.
    That's very happy new.

    Do you have some other suggestion on the other bug with SelectField (Combobox)

  10. #10

    Default

    Finally i fixed the problem by override the function:

    Ext.override(Ext.field.Select, {
    showPicker: function() {
    var me = this,
    store = me.getStore(),
    value = me.getValue();


    //check if the store is empty, if it is, return
    if (!store || store.getCount() === 0) {
    return;
    }


    if (me.getReadOnly()) {
    return;
    }


    me.isFocused = true;


    if (me.getUsePicker()) {
    var picker = me.getPhonePicker(),
    name = me.getName(),
    pickerValue = {};


    pickerValue[name] = value;
    picker.setValue(pickerValue);


    if (!picker.getParent()) {
    Ext.Viewport.add(picker);
    }


    picker.show();
    } else {
    var listPanel = me.getTabletPicker(),
    list = listPanel.down('list'),
    index, record;


    if (!listPanel.getParent()) {
    Ext.Viewport.add(listPanel);
    }


    listPanel.showBy(me.getComponent(), null);


    if (value || me.getAutoSelect()) {
    store = list.getStore();
    index = store.find(me.getValueField(), value, null, null, null, true);
    record = store.getAt(index);


    if (record) {
    list.select(record, null, true);
    } else {
    list.deselectAll();
    }
    }
    }
    }
    });



    The key is: deselect option when not value is selected which doesn't have in original code.
    list.deselectAll();
    Thank you for your time !

Page 1 of 2 12 LastLast

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
  •