mercredi 19 novembre 2014

setValue of Tag field is broken



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







  2. Default setValue of Tag field is broken



    setValue of Tag field is broken





    When you try to use setValue to a value that isn't already selected it won't work in a tag field (but it does in a combobox).To reproduce this bug select Hamburg and Berlin in the fiddle and then click on the button. If you now also select Vienna and click on the button it will work.http://ift.tt/1qpERjwThis has caused us much trouble, so I've traced down the problem to the wrong implementation of findRecord (probably this is still a leftover from ExtJS4 and would have worked there):

    Code:



    findRecord: function(field, value) { var store = this.store, matches; if (store) { matches = store.queryBy(function(rec) { return rec.isEqual(rec.get(field), value); }); } return matches || false;}

    The queryBy only returns [undefined x1] when I tried it during debugging.As workaround we now have overwritten that function and use the superclass (combobox) function, which will just do fine.

    Code:



    Ext.define('MR.overrides.form.field.Tag', { override: 'Ext.form.field.Tag', findRecord: function () { return this.superclass.findRecord.apply(this, arguments); }});

    PS: Your forum search is broken for me half of the time so, I couldn't check if this was already reported.PPS: Your edit function is also a pain in the ass, I can't get a line break for the love of god.












  3. Default







    Since it's nearly impossible to edit a thread without loosing the line breaks here it is formatted again:

    When you try to use setValue to a value that isn't already selected it won't work in a tag field (but it does in a combobox).


    To reproduce this bug select Hamburg and Berlin in the fiddle and then click on the button. If you now also select Vienna and click on the button it will work.


    http://ift.tt/1td1SRb


    This has caused us much trouble, so I've traced down the problem to the wrong implementation of findRecord (probably this is still a leftover from ExtJS4 and would have worked there):



    Code:



    findRecord: function(field, value) {
    var store = this.store,
    matches;
    if (store) {
    matches = store.queryBy(function(rec) {
    return rec.isEqual(rec.get(field), value);
    });
    }
    return matches || false;
    }

    The queryBy only returns [undefined x1] when I tried it during debugging.

    As workaround we now have overwritten that function and use the superclass (combobox) function, which will just do fine.



    Code:



    Ext.define('MR.overrides.form.field.Tag', {
    override: 'Ext.form.field.Tag',
    findRecord: function () {
    return this.superclass.findRecord.apply(this, arguments);
    }
    });

    PS: Your forum search is broken for me half of the time so, I couldn't check if this was already reported.

    PPS: Your edit function is also a pain in the ass, I can't get a line break for the love of god.













setValue of Tag field is broken

Aucun commentaire:

Enregistrer un commentaire