Issue with rendering controls in a grid column

Page 1 of 3 123 LastLast
  1. #1

    Issue with rendering controls in a grid column

    With Ext 1.X render of controls was working fine for our gridpanel but now ext controls are not getting rendered.
    With code given below everything was working fine.
    var RenderControls=function(){
    
     Ext.define('ModelPaymentMode', {
                       extend: 'Ext.data.Model',
                       fields: [
                           {name:"value", type:"string"},
                           {name:"text",type:"string"}
                       ]
                   });
                    var storePayMode = Ext.create('Ext.data.Store', {
                                  model: 'ModelPaymentMode',
                                  data:[
                                      {value: '0', text: 'Annual'},
                                      {value: '1', text: 'Semi-Annual'},
                                      {value: '2', text: 'Quarterly'},
                                      {value: '3', text: 'Monthly'}
                                   ]
                  
                    });
    
                 new Ext.form.ComboBox({
                                editable: false,
                                store: storeGender,
                                displayField: 'text',
                                valueField: 'value',
                                typeAhead: true,
                                queryMode: 'local',
                                forceSelection: true,
                                triggerAction: 'all',
                                selectOnFocus: true,
                                width: 80,
                                applyTo: 'ctl_12'
                            });
    
    
    }
    
    var RenderColumns = function (value, metadata, record, rowIndex, colIndex, store) {
     return "<input type='text' id='ctl_" + rowIndex + "_" + colIndex + "' value='" + value + "' >";
    }
    GridPanelLFView.AddScript("setTimeout(\"RenderControls();\",\"0.001\")");
    RenderColumns function is column renderer function.

    Please see the attached image of earlier(Ext1.1_gridpanel.JPG) and current(Ext2.2_GridPanel.JPG) GridPanel for reference.
    Click image for larger version. 

Name:	Ext2.2_GridPanel.JPG 
Views:	28 
Size:	40.0 KB 
ID:	6650Click image for larger version. 

Name:	Ext1.1_gridpanel.JPG 
Views:	24 
Size:	42.4 KB 
ID:	6651
    Last edited by rishu; Jul 29, 2013 at 11:15 AM.
  2. #2
  3. #3
    Thanks Vladimir, i want something like multiple editors but example given by you is creating columns and controls statically and i want to create controls dynamically as all the columns in grid are creating dynamically.
  4. #4
    Anything that defined in markup can be created in code behind if needed.
  5. #5
    Hi Daniil,

    Thanks for the reply!!!
    Renderer for component column is working smoothly but controls are not being rendered. I noticed in example that component column is having component and inside component we are placing different controls. So just tell me how we are going to get component at client side as i am placing controls directly in component column on column renderer.
  6. #6
    Quote Originally Posted by rishu View Post
    as i am placing controls directly in component column on column renderer.
    I don't think it will work.

    You could apply a dynamic config in the BeforeBind handler.
    <BeforeBind Handler="e.config = { xtype: 'textfield' };" />
  7. #7
    Quote Originally Posted by Daniil View Post
    I don't think it will work.

    You could apply a dynamic config in the BeforeBind handler.
    <BeforeBind Handler="e.config = { xtype: 'textfield' };" />
    BeforeBind event is part of which component(column/GridView/CellSelectionModel/GridPanel).
  8. #8
    It is a ComponentColumn's event.
  9. #9
    Quote Originally Posted by Daniil View Post
    <BeforeBind Handler="e.config = { xtype: 'textfield' };" />
    Hi Daniil,

    If its a event of component column then how i am going to use it for my scenario as i have a requirement of showing different controls in one column.I have around 9 rows each having different control. dynamic config given above will be applied to whole column. I cannot use this event.
  10. #10
    A ComponentColumn's BeforeBind is being triggered for each row.
Page 1 of 3 123 LastLast

Similar Threads

  1. Ext.Net 2.1.1 Controls rendering issue in IE7
    By rahesh in forum 2.x Help
    Replies: 3
    Last Post: Feb 21, 2013, 4:54 AM
  2. Problem of rendering tha last column of Grid panel
    By pars.engineer in forum 1.x Help
    Replies: 0
    Last Post: Oct 10, 2012, 8:08 AM
  3. Replies: 2
    Last Post: Feb 21, 2011, 5:22 AM
  4. Formatting issue with Grid Controls.
    By Rahul in forum 1.x Help
    Replies: 1
    Last Post: Jan 13, 2011, 10:01 AM
  5. Replies: 2
    Last Post: Apr 09, 2010, 11:28 AM

Posting Permissions