[CLOSED] Two ComboBox With ItemTpl SV:5696

  1. #1

    [CLOSED] Two ComboBox With ItemTpl SV:5696

    HI, i have a problem with two combox in a form with ItemTpl:
    If insert only one combobox it's work Ok, but if insert two combobox i retrive the javascript error:

    Riga: 37
    Errore: Syntax error, unrecognized expression: form>div.\:eq(0)

    it's not possible use two combobox with ItemTpl ?

    Thanks

    Aurelio

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataSource = new object[]
            {
                new object[]{"AL", "Alabama", "The Heart of Dixie"},
                new object[] { "AK", "Alaska", "The Land of the Midnight Sun"},
                new object[] { "AZ", "Arizona", "The Grand Canyon State"},
                new object[] { "AR", "Arkansas", "The Natural State"},
                new object[] { "CA", "California", "The Golden State"},
                
            };
    
            this.Store1.DataBind();
    
            this.Store2.DataSource = new object[]
            {
                new object[]{"AL", "Alabama", "The Heart of Dixie"},
                new object[] { "AK", "Alaska", "The Land of the Midnight Sun"},
                new object[] { "AZ", "Arizona", "The Grand Canyon State"},
                new object[] { "AR", "Arkansas", "The Natural State"},
                new object[] { "CA", "California", "The Golden State"},
                
            };
    
            this.Store2.DataBind();
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
         <style>
                .search-item
                {
                font: normal 10px tahoma, arial, helvetica, sans-serif;
                padding: 3px 10px 3px 10px;
                border: 1px solid #fff;
                border-bottom: 1px solid #eeeeee;
                white-space: normal;
                color: #555;
                height: 25px;
                }
             
                .search-item h3
                {           
                margin: 0;
                }
             
                .search-item h3 col1,.search-item h3 col3
                {
                font-weight: normal;
                margin: 0 0 5px 5px;
                width: 60px;
                }
             
                .search-item h3 col2, .search-item h3 col4
                {          
                font-weight: normal;  
                margin: 0 0 5px 5px;
                width: 100%;
                }
                
            </style>
    </head>
    <body>
        <form id="form1" runat="server">
         <ext:ResourceManager ID="ResourceManager1" runat="server" Namespace="" DirectMethodNamespace="Procedure">
                </ext:ResourceManager>
            <ext:Store ID="Store1" runat="server" IsPagingStore="true" PageSize="10">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="abbr" />
                                    <ext:ModelField Name="state" />
                                    <ext:ModelField Name="nick" />
                                </Fields>
                            </ext:Model>
                        </Model>            
                    </ext:Store>
                <ext:Store ID="Store2" runat="server" IsPagingStore="true" PageSize="10">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="abbr" />
                                    <ext:ModelField Name="state" />
                                    <ext:ModelField Name="nick" />
                                </Fields>
                            </ext:Model>
                        </Model>            
                    </ext:Store>
                <ext:Viewport ID="ViewportCon" runat="server" Layout="BorderLayout" PaddingSpec="5">
                    <Items>
                        <ext:FieldSet ID="FieldSetTestata" runat="server" Region="North" Title="Foglio" AnchorHorizontal="100%" Layout="HBoxLayout" Height="50">
                            <Items>
                                <ext:TextField ID="dspCodCan" runat="server" ReadOnly="true" FieldLabel="Cantina" LabelWidth="50" Width="150" Margins="0 50 0 0"/>
                                <ext:TextField ID="dspDatFog" runat="server" ReadOnly="true" FieldLabel="Data" LabelWidth="30" Width="150"/>
                            </Items>
                        </ext:FieldSet>
                        <ext:Panel ID="PanelMov" runat="server" Region="West" Width="300" MinWidth="100"
                                   BodyPadding="3" Layout="FitLayout" Split="true" Collapsible="true" TitleCollapse="true"
                                   Title="Movimenti cantina del giorno..." MaxWidth="700">
                            <Items>
                                <ext:GridPanel ID="GridPanelMov" runat="server" Title="Movimenti" >
                                    <ColumnModel>
                                        <Columns>
    
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
    
                                    </SelectionModel>
                                </ext:GridPanel>
                            </Items>
                        </ext:Panel>
                        <ext:FormPanel ID="FormPanelMov" runat="server"  ButtonAlign="Right"
                                       BodyPadding="5" Region="Center" DefaultButton="ButtonSave" Title="Movimento..."
                                       AnchorVertical="100%" MinWidth="300" >
                           
                            <FieldDefaults LabelWidth="100" />
                           
                            <Items>
                                <ext:FieldContainer ID="FieldContainerTpl" runat="server" AnchorHorizontal="100%" Layout="HBoxLayout" Height="50">
                                    <Defaults>
                                        <ext:Parameter Name="margins" Value="0 15 0 0" Mode="Value" />
                                    </Defaults>
                                    <Items>
                                        <ext:ComboBox 
                                            ID="ComboBoxLabCamTpl" 
                                            runat="server"  AllowBlank="false" BlankText="* Natura/Tipologia obbligatoria"
                                            EmptyText="Seleziona una Natura/Tipologia"
                                            TypeAhead="true"
                                            DisplayField="state" 
                                            ValueField="abbr"
                                            MinChars="1" FieldCls="txtObbligatorioCaseSensitive"
                                            FieldLabel="Natura/Tipologia"
                                            MatchFieldWidth="false" Width="350"
                                            StoreID="Store1" >
                                            <ListConfig ItemSelector=".x-boundlist-item">
                                                <ItemTpl ID="ItemTpl1" runat="server">
                                                    <Html>
                                                        <div class="search-item">
                                                            <h3>
                                                                <col1>{abbr} - </col1>
                                                                <col2>{state}</col2>
                                                            </h3>
                                                        </div>
                                                    </Html>
                                                </ItemTpl>
                                            </ListConfig>                                        
                                        </ext:ComboBox>
                                        <ext:DisplayField runat="server" FieldLabel="Tipo" LabelWidth="15" />
                                        <ext:ComboBox 
                                            ID="ComboBoxLabCamTip" 
                                            runat="server"
                                            EmptyText="Seleziona un tipo..."
                                            TypeAhead="true"
                                            DisplayField="state" 
                                            ValueField="abbr"
                                            MinChars="1"                                      
                                            MatchFieldWidth="false"
                                            StoreID="Store2" Width="350"  >
                                            <ListConfig >
                                                <ItemTpl ID="ItemTpl2" runat="server">
                                                    <Html>
                                                        <div class="search-item">
                                                            <h3>
                                                                <col3>{abbr} - </col3>
                                                                <col4>{state}</col4>
                                                            </h3>
                                                        </div>
                                                    </Html>
                                                </ItemTpl>
                                            </ListConfig>
                                        </ext:ComboBox>                                  
                                    </Items>
                                </ext:FieldContainer>                            
                            </Items>                    
                        </ext:FormPanel>
                    </Items>
                </ext:Viewport>
    
        </form>
    </body>
    </html>
    Last edited by Daniil; Mar 04, 2014 at 10:59 AM. Reason: [CLOSED]
  2. #2
    Hi @Aurelio,

    I cannot reproduce. What browser (-s) are you testing with?

    Quote Originally Posted by Aurelio View Post
    it's not possible use two combobox with ItemTpl ?
    There is no such a restriction.
  3. #3
    Could you also clarify what are <col1>, <col2>, etc.?:)

    Seems I have never seen such tags. Also I cannot find anything on the internet.
  4. #4
    Hi..Danil
    Sorry for not having specified the browser...

    The problem apper only in IE 11...
    FireFox or Chrome work ok..

    This is the error with appear in VS 2013...

    Unhandled exception at line 37, column 59140 in http://localhost:1200/49bb86c84dfe44...fe/browserLink

    0x800a139e - Errore di run-time di JavaScript: Syntax error, unrecognized expression: form>div.\:eq(0)


    The col2-col3 is use only for the css..

    After other test, the problem of the error for IE is:
    The class="search-item" in the <div>, if leave this it's work

    <ItemTpl ID="ItemTpl2" runat="server">
                                                <Html>
                                                    <div class="search-item" >
                                                            <h3>
                                                                <col1>{abbr} - </col1>
                                                                <col2>{state}</col2>
                                                            </h3>
                                                        </div>
                                                </Html>
                                            </ItemTpl>
    Thanks
    Aurelio
    Last edited by Aurelio; Mar 04, 2014 at 9:26 AM.
  5. #5
    Quote Originally Posted by Aurelio View Post
    The problem apper only in IE 11...

    This is the error with appear in VS 2013...

    Unhandled exception at line 37, column 59140 in http://localhost:1200/49bb86c84dfe44...fe/browserLink

    0x800a139e - Errore di run-time di JavaScript: Syntax error, unrecognized expression: form>div.\:eq(0)
    I cannot reproduce in IE11 of Windows 7. I don't see any error. What OS is on your side? Is the problem reproduced with VS 2013 only?

    Quote Originally Posted by Aurelio View Post
    The col2-col3 is use only for the css..
    Ok, for it.

    Quote Originally Posted by Aurelio View Post
    After other test, the problem of the error for IE is:
    The class="search-item" in the <div>, if leave this it's work

    <ItemTpl ID="ItemTpl2" runat="server">
                                                <Html>
                                                    <div class="search-item" >
                                                            <h3>
                                                                <col1>{abbr} - </col1>
                                                                <col2>{state}</col2>
                                                            </h3>
                                                        </div>
                                                </Html>
                                            </ItemTpl>
    Do you mean if remove class="search-item" it starts working for you? If so, please try to remove the CSS rules for that class step by step and re-test the page for each removal. Maybe, you could catch an exact CSS rule that causes the problem.
  6. #6
    Hi..Daniil

    Leave all css property, the error still appear, but i have find the problem:

    Is VS 2013, i have open the project on another machine with VS 2012 (and in the same machine) and the error not appear...

    The cause seems to be: VS2013 (grgrgrgr !!!)

    Sorry for the inconvenience..

    Now I try to see what the problem is on VS2013.. In this case the problem is JQuery with VS2013.

    Close the Thread

    Many Thanks

    Aurelio
    Last edited by Aurelio; Mar 04, 2014 at 10:57 AM.
  7. #7
    I've got a solution for this...other than abandoning 2013. VS now has a technology called BrowserLink which can in rare instances interfere with page rendering. I just had the exact same thing happen with me; same error and everything. Instead of having to remember to turn BrowserLink off in the IDE, as it is on by default, add the following to your appSettings:

    <add key="vs:EnableBrowserLink" value="false"/>
    That should take care of your issue. Happy coding!
  8. #8
    Hi.. FloatingPoint

    thanks for the solution, i have disable this in the web.config and work, the problem is only with IE

    <compilation debug="false" targetFramework="4.0">
    Thanks
    Aurelio

Similar Threads

  1. [CLOSED] How can I change fields inside <ItemTpl> in client side
    By crsodre in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 17, 2013, 9:16 PM
  2. Replies: 5
    Last Post: Mar 15, 2013, 4:24 AM
  3. [CLOSED] ItemTpl for Razor
    By gets_gui in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 30, 2012, 3:37 PM
  4. [CLOSED] V2.1 Combobox ItemTpl
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 01, 2012, 4:36 AM
  5. Replies: 4
    Last Post: Nov 30, 2011, 5:25 AM

Posting Permissions