[FIXED] [2.5] TagField crashes when using StoreID property

  1. #1

    [FIXED] [2.5] TagField crashes when using StoreID property

    Hello,
    I have a problem using TagField with separately defined Store.

    For the field declared as below:

    <ext:TagField runat="server" ID="myTagField" StoreID="someStore" ForceSelection="true" Editable="false" HideSelected="true"
                  Note="Lorem ipsum lorem ipsum" ValueField="Code" DisplayField="Display" BlankText="All">
                  <CustomConfig>
                    <ext:ConfigItem Name="autoWidth" Value="true" />
                  </CustomConfig>
    </ext:TagField>
    I get the following error in function initTagsStore of a Ext.net.TagField class,
    because for me this.store is a String - id of the store.

    'store' is undefined
    in line 775 of the debug version of the js file

    initTagsStore : function () {
            if (Ext.isArray(this.store)) {
                this.displayField = "text";
                this.valueField = "value";
                return new Ext.data.Store({
                    data  : this.store,
                    fields: [
                        "text",
                        "value",
                        "selected",
                        "iconCls",
                        "disabled",
                        "cls",
                        "qTitle",
                        "qTip",
                        "width",
                        "style",
                        "closable",
                        "overCls"
                    ],
                    autoDestroy: true
                });
            }
    
            return store; // JS ERROR HERE
        }
    I was able to provide fix for it, by overriding this method as follows:

    Ext.define('Ext.net.TagFieldFix', {
            override: 'Ext.net.TagField',
    
            initTagsStore: function ()
            {
                if (Ext.isArray(this.store))
                {
                    this.displayField = "text";
                    this.valueField = "value";
                    return new Ext.data.Store({
                        data: this.store,
                        fields: [
                        "text",
                        "value",
                        "selected",
                        "iconCls",
                        "disabled",
                        "cls",
                        "qTitle",
                        "qTip",
                        "width",
                        "style",
                        "closable",
                        "overCls"
                    ],
                        autoDestroy: true
                    });
                }
                else if (typeof this.store == 'String')
                {
                    var st = Ext.StoreMgr.get(this.store);
                    return st;
                }
    
                return this.store;
            }
        });
    However, I am quite new to both Ext.NET and Ext.js so I am not sure if the fix is suitable, it solved my issue though.

    Thanks,
    Damian
    Last edited by Daniil; Jan 07, 2014 at 5:23 AM. Reason: [FIXED] [2.5]
  2. #2
    Hi @Damian,

    Welcome to the Ext.NET forums!

    Thank you for the report!

    Your fix is good, but it is enough just to replace
    return store;
    with
    return this.store;
    Fixed in SVN, revision 5593.
  3. #3
    NuGet Version still have this problem. There is another way to fix it to NuGet version?
    Or I need download, compile and replace?
    Last edited by equiman; Jan 31, 2014 at 4:46 AM.
  4. #4
    Quote Originally Posted by equiman View Post
    NuGet Version still have this problem. There is another way to fix it to NuGet version?
    Or I need download, compile and replace?
    The NuGet version will be updated when Ext.NET 2.5 is officially released. At the moment we do not have an official release date for Ext.NET 2.5, but the main development for the release is now finished and we're in testing mode for a few weeks.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Simple Tagfield from Codebehind.
    By waxby in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 06, 2014, 2:51 PM
  2. Replies: 2
    Last Post: Oct 25, 2013, 2:49 AM
  3. [CLOSED] Combobox, StoreId and set value in code behind
    By Svr77 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 24, 2013, 4:00 PM
  4. [OPEN] Crashes, crashes, crashes...
    By swallace in forum Bugs
    Replies: 18
    Last Post: Sep 16, 2011, 6:17 AM
  5. [CLOSED] ListFilter with a StoreID
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: Oct 08, 2010, 1:51 PM

Tags for this Thread

Posting Permissions