[CLOSED] The ItemSelector can not be empty

  1. #1

    [CLOSED] The ItemSelector can not be empty

    Hi Guys,

    Wondering why I receive above error when using a simple dataview.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KlantInfo.aspx.cs" Inherits="Support.Customer.KlantInfo" %>
    
    
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Store ID="strKlantInfo" runat="server">
                <Model>
                    <ext:Model runat="server" IDProperty="ID">
                        <Fields>
                            <ext:ModelField Name="cAandachtsPunt" />
                            <ext:ModelField Name="cBeschrijving" />
                        </Fields>
                    </ext:Model>
                </Model>
            </ext:Store>
            <ext:Viewport ID="vpKlantInfo" runat="server" Layout="Fit">
                <Items>
                    <ext:Panel
                        ID="pnlKlantInfo"
                        runat="server"
                        Frame="true"
                        Layout="FitLayout">
                        <Items>
                            <ext:DataView
                                ID="dvKlantInformatie"
                                runat="server"
                                StoreID="strKlantInfo"
                                DisableSelection="true">
                                <Tpl runat="server">
                                    <Html>
                                        <tpl for=".">
                                    <div>
                                        <div style="font-weight: bold;background-color:lightgrey">{cAandachtsPunt}></div>
                                        <span>{cBeschrijving}</span>
                                    </div>
                                </tpl>
                                    </Html>
                                </Tpl>
                            </ext:DataView>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    Last edited by Daniil; Dec 01, 2015 at 3:48 PM. Reason: [CLOSED]
  2. #2
    Hi Martin,

    ItemSelector is a required setting and must be set even in a simple DataView.
    http://docs.sencha.com/extjs/5.1/5.1...g-itemSelector

    I would recommend to change the outer
    <div>
    to
    <div class="my-item">
    and set ItemSelector="div.my-item" for the DataView.

    You don't really need to set any CSS rules for the "my-item" class. In this case it is just a marker to distinguish the outer div from others.
  3. #3
    Thanks Daniil,

    Expected that ''DisableSelection" would do the trick :)

    Martin
  4. #4
    Agree, it could potentially do that job, but yes, it doesn't it:)

Similar Threads

  1. Replies: 2
    Last Post: May 05, 2015, 1:49 PM
  2. Example Databind Multiselect / itemselector
    By iomega55 in forum 2.x Help
    Replies: 1
    Last Post: Oct 21, 2014, 6:54 AM
  3. [CLOSED] ItemSelector data binding
    By paulc in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 11, 2014, 4:07 AM
  4. Replies: 2
    Last Post: Jul 05, 2012, 8:49 AM
  5. How to load itemselector
    By amanind in forum 1.x Help
    Replies: 0
    Last Post: Jul 21, 2010, 11:18 AM

Posting Permissions