Problem Editor combobox control in gridpanel

  1. #1

    Problem Editor combobox control in gridpanel

    Hi!......


    I am using a combo box inside my grid panel....
    this combo box's store is getting loaded from code behind...i have used the renderer to load the store in to my combo box..tats working fine....

    but the issue is wen i select a value in the combo box ...its not getting displayed in grid...wen i move to the next row or celll..the selected value disappears...

    how to overcome it ???? ..pls help..........
  2. #2
    Hi,

    I guess there is mapping problem.

    Did you investigate this example (Department column)?
    https://examples1.ext.net/#/GridPane...Field_Mapping/
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    I guess there is mapping problem.

    Did you investigate this example (Department column)?
    https://examples1.ext.net/#/GridPane...Field_Mapping/

    I investigated that sample already Daniil....

    im assigning a datatable as a store to the combo box.....Hence get , set methods doesn't provide me the proper solution which i want...


    Example:

     tb =//some datatable
    
     Store2.DataSource = tb;
     Store2.DataBind();
    how can i use in this scenarion...
    pls help.....
    Last edited by geoffrey.mcgill; May 26, 2011 at 4:51 AM. Reason: please use [CODE] tags
  4. #4
    Unfortunately, the info you provide is not enough for me to determine the problem.

    Please provide a full, but simplified, sample to reproduce the problem.
  5. #5
    Quote Originally Posted by Daniil View Post
    Unfortunately, the info you provide is not enough for me to determine the problem.

    Please provide a full, but simplified, sample to reproduce the problem.

    <ext:Column Header="Level" DataIndex="USERLEVEL" Width="100">
                                        <Renderer Fn="levelRenderer"/>    
                            <Editor>
                             <ext:ComboBox ID="ComboBox2" runat="server" Width="50" Editable="false" DataIndex ="Id" DisplayField ="Name" ValueField ="Id"     Mode="Local" 
                                    TriggerAction="All" 
                                    ForceSelection="true" >
                                      <Store>  
            <ext:Store ID="Store4" runat="server">  
              <Reader>   
          <ext:JsonReader IDProperty="Id"> 
       <Fields>
                                   
                                                <ext:RecordField Name="Id" />
                                                 
                                                <ext:RecordField Name="NAME" />    
                                    </Fields>                      
             </ext:JsonReader>                      
            </Reader>                              
          </ext:Store>  
            </Store>    
                                      
                                    </ext:ComboBox>
                                    
                            </Editor>
                        </ext:Column>
    ///////////////////////////  renderer here/////////////////////
    
    
    
       
                var levelRenderer = function (value) {  
     //var record = ComboBox1.getStore().getAt(ComboBox1.getSelectionModel().getSelectedCell()[0]);
               var r = #{ComboBox2}.getStore().getById(value);    
              if (Ext.isEmpty(r)) {  
               return "xxx";             }   
                    return r.data.Name;     
                       }; 
    
    
    
    ///////////loading store here//////////////////////
    
    
    
       public class LEVELNAME
        {
            public int Id { get; set; }
            public string Name { get; set; }
    
            public static List<LEVELNAME> GetAll()
            {
                return new List<LEVELNAME>
                           {
                               new LEVELNAME {Id = 1, Name = "FORWARDER1"},
                               new LEVELNAME {Id = 2, Name = "FORWARDER2"},
                               new LEVELNAME {Id = 3, Name = "APPROVER"}
                           };
            }
        }
    
    
    
    //page load
    
    
    this.Store4.DataSource = LEVELNAME.GetAll();
           this.Store4.DataBind();

    Pls help...............
    Last edited by Daniil; May 26, 2011 at 8:41 AM. Reason: Please use [CODE] tags
  6. #6
    new LEVELNAME {Id = 1, Name = "FORWARDER1"},
    
    <ext:RecordField Name="NAME" />
    
    return r.data.Name;
    These things are case sensitive.
  7. #7
    Quote Originally Posted by Daniil View Post
    new LEVELNAME {Id = 1, Name = "FORWARDER1"},
    
    <ext:RecordField Name="NAME" />
    
    return r.data.Name;
    These things are case sensitive.
    oh ....i got it ...thanx Daniiil

Similar Threads

  1. Replies: 2
    Last Post: May 05, 2011, 10:16 AM
  2. combobox editor problem
    By adayioglu in forum 1.x Help
    Replies: 1
    Last Post: Oct 25, 2010, 10:45 PM
  3. Problem With editor in MasterPages & User web Control
    By firebird_design in forum 1.x Help
    Replies: 2
    Last Post: Sep 08, 2010, 1:57 PM
  4. Replies: 5
    Last Post: Jun 10, 2009, 5:13 AM
  5. Replies: 0
    Last Post: Feb 25, 2009, 6:05 PM

Posting Permissions