mardi 17 février 2015

Combobox Bug: Edit text when selection.



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







  2. Default Combobox Bug: Edit text when selection.



    Combobox Bug: Edit text when selection.





    If you try an edit the text of a combobox when a record is selected, it clears field. It seems like it should keep the edited text. For example:

    cb_bug.png


    I saw some similar bug reports, but they seemed to be marked as fixed and this is still an issue in the latest nightly.


    Here's a fiddle: http://ift.tt/1EMU2Fa


    Also, the behavior in 4.2.3 is as I would expect. See example in: http://ift.tt/1EMU5ke


    Here's my current override:



    Code:




    updateValue: function() {
    var me = this,
    selectedRecords = me.valueCollection.getRange(),
    len = selectedRecords.length,
    valueArray = [],
    displayTplData = me.displayTplData || (me.displayTplData = []),
    inputEl = me.inputEl,
    i, record;

    // Loop through values, matching each from the Store, and collecting matched records
    displayTplData.length = 0;
    for (i = 0; i < len; i++) {
    record = selectedRecords[i];
    displayTplData.push(record.data);

    // There might be the bogus "value not found" record if forceSelect was set. Do not include this in the value.
    if (record !== me.valueNotFoundRecord) {
    valueArray.push(record.get(me.valueField));
    }
    }
    // Set the value of this field. If we are multiselecting, then that is an array.
    me.setHiddenValue(valueArray);
    me.value = me.multiSelect ? valueArray : valueArray[0];
    if (!Ext.isDefined(me.value)) {
    me.value = undefined;
    }
    me.displayTplData = displayTplData; //store for getDisplayValue method

    if (inputEl && me.emptyText && !Ext.isEmpty(me.value)) {
    inputEl.removeCls(me.emptyCls);
    }
    // Calculate raw value from the collection of Model data
    if (!me.getRawValue() || selectedRecords.length) {
    me.setRawValue(me.getDisplayValue());
    me.checkChange();
    me.applyEmptyText();
    }


    }








    Last edited by jonw; Today at 6:07 PM.


    Reason: update override











Combobox Bug: Edit text when selection.

Aucun commentaire:

Enregistrer un commentaire