[CLOSED] [#667] TagField in Toolbar items throw "Unable to get property 'dataSource' of undefined or null reference"

  1. #1

    [CLOSED] [#667] TagField in Toolbar items throw "Unable to get property 'dataSource' of undefined or null reference"

    Hi,

    I would like to place TagField on one of my tool bars. When I do this following error is thrown:

    Unable to get property 'dataSource' of undefined or null reference


    <%@ Page Language="C#" %>
    <!DOCTYPE html>
    
    <html>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" ScripMode="Debug"/>
            <ext:Toolbar runat="server">
                <Items>
                    <ext:Button runat="server" Text="This button is fine"   />
                    
                    <ext:TagField runat="server">
                        <Tags>
                            <ext:Tag Value="1" />
                        </Tags>
                        <Items>
                            <ext:Tag Value="1" Text="George" Icon="User" />
                            <ext:Tag Value="2" Text="Bob" Icon="UserAdd" />
                            <ext:Tag Value="3" Text="John" Icon="UserAlert" />
                            <ext:Tag Value="4" Text="Bill" Icon="UserB" />
                            <ext:Tag Value="5" Text="Ronald" Icon="UserDelete" />
                        </Items>
                    </ext:TagField>
                </Items>
            </ext:Toolbar>
        </form>
    </body>
    </html>
    Last edited by Daniil; Jan 30, 2015 at 9:21 AM. Reason: [CLOSED] [#667]
  2. #2
    Hi Matt,

    It breaks with both - Ext.NET 3.0 and the latest from the SVN trunk.

    Thank you for the report! We will investigate.
  3. #3
    Created an Issue:
    https://github.com/extnet/Ext.NET/issues/667

    Fixed in the revision #6291 (trunk). It goes to 3.1.0 beta.

    On choosing items a TagField could grow vertically or horizontally. I can suggest the following solutions.

    Vertically
    <ext:TagField runat="server">
        <Listeners>
            <Change Handler="this.ownerCt.doLayout();" />
        </Listeners>
    </ext:TagField>
    Horizontally
    <ext:TagField runat="server">
        <Listeners>
            <Change Fn="doAutoWidth" />
        </Listeners>
    </ext:TagField>
    var doAutoWidth = function (tagField) {
        var width = 0;
    
        tagField.tagLabel.el.select("li").each(function (li) {
            width += li.getWidth();
        });
    
        tagField.setWidth(width + 35);
    };

Similar Threads

  1. Replies: 8
    Last Post: Apr 30, 2014, 3:59 AM
  2. Replies: 3
    Last Post: Mar 13, 2014, 3:58 PM
  3. Replies: 0
    Last Post: Jan 30, 2014, 2:24 PM
  4. Replies: 12
    Last Post: Oct 30, 2013, 6:51 AM
  5. Replies: 1
    Last Post: Nov 12, 2012, 2:29 PM

Tags for this Thread

Posting Permissions