Combobox Renderer in Gridpanel bug

Page 1 of 2 12 LastLast
  1. #1

    Combobox Renderer in Gridpanel bug



    Hi there,


    My goal is to have a GridPanel with a column that will be a combobox, however I want this combobox to display a text name but store a unique identifier behind the scenes.


    I have a working example, but have found that a specific sequence of user actions is causing the unique identifier to display instead of the text.



    I have attached the sequence of events in the attached JPG (SequenceScreenShot.jpg).


    Following is the code to reproduce my problem.


    Thanks for all the work and support you guys are doing on this!


    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataSource = new object[] 
            { 
                new object[] { "AL", "1",}, 
                new object[] { "AK", "2",}, 
                new object[] { "AZ", "3",}, 
                new object[] { "AR", "4",}, 
                new object[] { "CA", "5",} 
            };
            
            this.Store1.DataBind();
    
    
            this.Store2.DataSource = new object[] 
            { 
                new object[] { "John", "1"}, 
                new object[] { "James", "2"}, 
                new object[] { "Jerry", "3"}, 
                new object[] { "Horatio", "4"}, 
                new object[] { "Bob", "5"} ,
                new object[] { "Larry", "5"} 
            };
            
            this.Store2.DataBind();
        }
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>ComboBox Example</title>
    </head>
    
    
    
    <script>
    function RenderStateName(value) {
        if(value)
            return Store1.getById(value).data.state;
    }
    </script>
    
    
    <body style="margin:10px;">
        <form id="form1" runat="server">
        
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            
            <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:ArrayReader ReaderID="id">
                        <Fields>
                            <ext:RecordField Name="state" />
                            <ext:RecordField Name="id" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            
            <ext:Store ID="Store2" runat="server">
                <Reader>
                    <ext:ArrayReader ReaderID="stateId">
                        <Fields>
                            <ext:RecordField Name="name" />
                            <ext:RecordField Name="stateId" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            
        
        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store2" Height="300">
            <ColumnModel ID="ColumnModel2" runat="server">
                <Columns>
                    <ext:Column DataIndex="name" Header="Name" />
                    <ext:Column ColumnID="state" DataIndex="stateId" Header="State" Width="200">
                        <Renderer Fn="RenderStateName" />
                        <Editor>
                            <ext:ComboBox   ID="cb1" runat="server" StoreID="Store1" 
                                            DisplayField="state" ValueField="id"
                                            AllowBlank="false" Mode="local">
                            </ext:ComboBox>
                        </Editor>
                    </ext:Column>
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
        </form>
    </body>
    </html>
  2. #2

    RE: Combobox Renderer in Gridpanel bug

    Hi Washburn,

    Thanks for the great sample. I have reproduced the problem.


    We're investigating a fix, and given the implications of this defect, solving this problem is a high priority for us.*


    Geoffrey McGill
    Founder
  3. #3

    RE: Combobox Renderer in Gridpanel bug

    Any idea's on possible work-around or alternate solutions until this bug is fixed?

    Regards,

    Michael
  4. #4

    RE: Combobox Renderer in Gridpanel bug

    Hi,

    Just add to the ComboBox TriggerAction="All"*





  5. #5

    RE: Combobox Renderer in Gridpanel bug

    The default value of the TriggerAction property is now "All". You do need to explicitly set the property.*

    The change will be included with the public release of v0.8.0 or via SVN to subscribers.*


    Hope this helps.


    Geoffrey McGill
    Founder
  6. #6

    RE: Combobox Renderer in Gridpanel bug

    Hi Washburn,

    Any updates on your status? did setting the TriggerAction = true sloved your problem? Thanks.
  7. #7

    RE: Combobox Renderer in Gridpanel bug

    Hi yaser82,

    Thanks for the follow up. Setting TriggerAction = true seemed to solve the problem, but I have found another sequence of events that will cause the id to be displayed again.

    The only thing I have changed from the previous code sample is the following :

    <ext:ComboBox   ID="cb1" runat="server" StoreID="Store1" 
      DisplayField="state" ValueField="id"
      AllowBlank="false" Mode="local" TriggerAction="All">
    </ext:ComboBox>
    I have attached the sequence of events in the attached JPG (SequenceScreenShot2.jpg).
  8. #8

    RE: Combobox Renderer in Gridpanel bug

    I got the same problem.

    My solution, although kinda silly, but 100% successful, is to add an empty field or any text you want to the store, and bind that field to your column.

    Hope this will be fixed in the next version.
  9. #9

    RE: Combobox Renderer in Gridpanel bug

    Hi Washburn,

    To solve your problem need clear filter of combo store. Please see the following sample

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataSource = new object[] 
            { 
                new object[] { "AL", "1",}, 
                new object[] { "AK", "2",}, 
                new object[] { "AZ", "3",}, 
                new object[] { "AR", "4",}, 
                new object[] { "CA", "5",} 
            };
            
            this.Store1.DataBind();
    
    
            this.Store2.DataSource = new object[] 
            { 
                new object[] { "John", "1"}, 
                new object[] { "James", "2"}, 
                new object[] { "Jerry", "3"}, 
                new object[] { "Horatio", "4"}, 
                new object[] { "Bob", "5"} ,
                new object[] { "Larry", "5"} 
            };
            
            this.Store2.DataBind();
        }
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>ComboBox Example</title>
    </head>
    
    
    
    <script>
    function RenderStateName(value) {
        if(value)
            return Store1.getById(value).data.state;
    }
    </script>
    
    
    <body style="margin:10px;">
        <form id="form1" runat="server">
        
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            
            <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:ArrayReader ReaderID="id">
                        <Fields>
                            <ext:RecordField Name="state" />
                            <ext:RecordField Name="id" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            
            <ext:Store ID="Store2" runat="server">
                <Reader>
                    <ext:ArrayReader ReaderID="stateId">
                        <Fields>
                            <ext:RecordField Name="name" />
                            <ext:RecordField Name="stateId" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            
        
        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store2" Height="300">
            <ColumnModel ID="ColumnModel2" runat="server">
                <Columns>
                    <ext:Column DataIndex="name" Header="Name" />
                    <ext:Column ColumnID="state" DataIndex="stateId" Header="State" Width="200">
                        <Renderer Fn="RenderStateName" />
                        <Editor>
                            <ext:ComboBox   ID="cb1" runat="server" StoreID="Store1" 
                                            DisplayField="state" ValueField="id" TriggerAction="All"
                                            AllowBlank="false" Mode="local">
                            </ext:ComboBox>
                        </Editor>
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <Listeners>
                <AfterEdit Handler="this.getColumnModel().config[1].editor.field.store.clearFilter();" />
            </Listeners>
        </ext:GridPanel>
        </form>
    </body>
    </html>
  10. #10

    RE: Combobox Renderer in Gridpanel bug

    the bug is still,help.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 18
    Last Post: Apr 14, 2010, 2:00 PM
  2. Gridpanel Row Renderer
    By DasPhansom in forum 1.x Help
    Replies: 5
    Last Post: Jul 20, 2009, 6:49 AM
  3. GridPanel Renderer
    By JonG in forum 1.x Help
    Replies: 0
    Last Post: Jul 10, 2009, 5:28 AM
  4. Replies: 2
    Last Post: Mar 30, 2009, 5:52 PM
  5. Replies: 5
    Last Post: Mar 23, 2009, 7:43 PM

Posting Permissions