1. #1
    Ext User
    Join Date
    Nov 2007
    Posts
    23
    Vote Rating
    0
    jonesmc123 is on a distinguished road

      0  

    Question Ext.grid.CheckColumn is not a constructor

    Ext.grid.CheckColumn is not a constructor


    this code example chowing how to use the CheckColumn plugin seems to work fine, but when I try and replicate it into my code I get:
    Ext.grid.CheckColumn is not a constructor

    I'm going by the edit-grid example in the ext.2.0 examples

    I'm fairly new to javascript so I'm having a bit of trouble debugging this.
    Any pointers would be greatly appreciated. Here's the CheckColumn plug-in in my code

    in fact I get that is not a constructor error on anything that is a plug-in and extends some class, am I missing an include or something?

    Code:
    <script type="text/javascript" charset="utf-8">
        
        var grid_store;
        var selectionModel;
        var otherSelModel;
        var contact_grid;
    
        Ext.grid.CheckColumn = function(config){
            Ext.apply(this, config);
            if(!this.id){
                this.id = Ext.id();
            }
            this.renderer = this.renderer.createDelegate(this);
        };
    
        Ext.grid.CheckColumn.prototype ={
            init : function(grid){
                this.grid = grid;
                this.grid.on('render', function(){
                    var view = this.grid.getView();
                    view.mainBody.on('mousedown', this.onMouseDown, this);
                }, this);
            },
    
            onMouseDown : function(e, t){
                if(t.className && t.className.indexOf('x-grid3-cc-'+this.id) != -1){
                    e.stopEvent();
                    var index = this.grid.getView().findRowIndex(t);
                    var record = this.grid.store.getAt(index);
                    record.set(this.dataIndex, !record.data[this.dataIndex]);
                }
            },
    
            renderer : function(v, p, record){
                p.css += ' x-grid3-check-col-td'; 
                return '<div class="x-grid3-check-col'+(v?'-on':'')+' x-grid3-cc-'+this.id+'"> </div>';
            }
        };
    
        Ext.onReady(function(){
            
            
            Ext.QuickTips.init();
            // turn on validation errors beside the field globally
            Ext.form.Field.prototype.msgTarget = 'side';
            
           init_results_grid();
           setup_form();
            
        });
    
        function init_results_grid()
    	{
    
            //custom column plugin example
            var checkColumn = new Ext.grid.CheckColumn({
               header: "Already in contacts?",
               dataIndex: 'on_contact_list',
               width: 55
            }); 
    
            json_reader = new Ext.data.JsonReader({
                root: 'datarows',
                totalProperty: 'totalCount',
                fields: [
                   {name: 'id',type: 'int'},
                   {name: 'on_contact_list',type: 'bool'},
                   {name: 'first_name'},
                   {name: 'last_name'},
                   {name: 'email'},
                   {name: 'work_phone'},
                   {name: 'company'},
                   {name: 'organization'}
                ]
            });
            
            grid_store = new Ext.data.GroupingStore({
                proxy: new Ext.data.HttpProxy({
                    url: '/contacts/search_contacts/'
                    
                }),
                reader : json_reader,
                sortInfo:{field: 'last_name', direction: "ASC"},
                groupField:'organization'
            });
            
            selectionModel = new Ext.grid.CheckboxSelectionModel();
            otherSelModel = new  Ext.grid.CheckboxSelectionModel();
            contact_grid = new Ext.grid.EditorGridPanel({
                el: 'search_results',
                store: grid_store,
                stripeRows: true,
                cm: new Ext.grid.ColumnModel([
                    selectionModel,
                    {id:'id', dataIndex: 'id', hidden: true},
                    checkColumn,
                    {header: "Already a contact?", width: 100, sortable: true, dataIndex: 'on_contact_list'},
                    {header: "First Name", width: 100, sortable: true, dataIndex: 'first_name'},
                    {header: "Last Name", width: 100, sortable: true, dataIndex: 'last_name'},
                    {header: "Email", width: 100, sortable: true, dataIndex: 'email'},
                    {header: "Office Phone", width: 100, sortable: true, dataIndex: 'work_phone'},                                                                                
                    {header: "Organization",width: 80,sortable: true,dataIndex: 'organization'},
                    {header: "Company", width: 80, sortable: true, dataIndex: 'company'}
                ]),
                view: new Ext.grid.GroupingView({
                    forceFit:true,
                    groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
                }),
                sm: otherSelModel,
                // inline toolbars
                tbar:[{
                    text:'Save',
                    tooltip:'Add checked contacts to your contact list',
                    iconCls:'add',
                    handler : function(){
                        rows = contact_grid.getSelectionModel().getSelections();
                        contacts_to_add = [rows.length];
                        for(var i=0;i<rows.length;i++)
                        {
                          contacts_to_add[i] = rows[i].data.id;
                        }
                        var contactsJSON = Object.toJSON(contacts_to_add)
                        //ajax call here
                      }
                }],
                width:450,
                height:350,
                plugins:checkColumn,
                loadMask: true,
                title:"Contact search results",
                bbar: new Ext.PagingToolbar({
                    pageSize: 10,
                    store: grid_store,
                    displayInfo: true,
                    displayMsg: 'Displaying contacts {0} - {1} of {2}',
                    emptyMsg: "No contacts to display"
                })
            });
    
            contact_grid.render();
    	}
        
        function setup_form()
        {
        }    
    </script>
    <div style="height:500px; overflow:auto">
        <div id="search_input"></div>
        <div id="search_results"></div>
    </div>

  2. #2
    Ext User
    Join Date
    Dec 2007
    Posts
    4
    Vote Rating
    0
    ebald is on a distinguished road

      0  

    Default Did you resolve it?

    Did you resolve it?


    I

  3. #3
    Sencha User bkraut's Avatar
    Join Date
    Nov 2007
    Location
    Maribor, Slovenia
    Posts
    402
    Vote Rating
    1
    bkraut is on a distinguished road

      0  

    Default


    I noticed it also, but I figured it out if you define the Ext.grid.CheckColumn before doing something with it you won't get this error.

    Shortly - it is a matter of the position in the file - put it up.

  4. #4
    Ext User
    Join Date
    Aug 2007
    Posts
    61
    Vote Rating
    0
    hash_man is on a distinguished road

      0  

    Default I got the same error?How to resolve?

    I got the same error?How to resolve?


    I got the same error?How to resolve?
    Michael Gao

  5. #5
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Include the javascript required for that checkcolumn! Check the examples
    It's not part of the core EXT suite.

  6. #6
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    PHP Code:
    Ext.grid.CheckColumn = function(config){
        
    Ext.apply(thisconfig);
        if(!
    this.id){
            
    this.id Ext.id();
        }
        
    this.renderer this.renderer.createDelegate(this);
    };

    Ext.grid.CheckColumn.prototype ={
        
    init : function(grid){
            
    this.grid grid;
            
    this.grid.on('render', function(){
                var 
    view this.grid.getView();
                
    view.mainBody.on('mousedown'this.onMouseDownthis);
            }, 
    this);
        },

        
    onMouseDown : function(et){
            if(
    t.className && t.className.indexOf('x-grid3-cc-'+this.id) != -1){
                
    e.stopEvent();
                var 
    index this.grid.getView().findRowIndex(t);
                var 
    record this.grid.store.getAt(index);
                
    record.set(this.dataIndex, !record.data[this.dataIndex]);
            }
        },

        
    renderer : function(vprecord){
            
    p.css += ' x-grid3-check-col-td'
            return 
    '<div class="x-grid3-check-col'+(v?'-on':'')+' x-grid3-cc-'+this.id+'"> </div>';
        }
    }; 

  7. #7
    Ext User
    Join Date
    Jun 2008
    Posts
    28
    Vote Rating
    0
    morange is on a distinguished road

      0  

    Default checking one cell in grid

    checking one cell in grid


    How can i use Ext.grid.CheckColumn to check a single cell in a grid.
    Can i use the geColumnModel().getSelectedCell() method inside mouseDown() method.
    If use this it throws cell has no properties.

    How to use this to check one cell in the grid . What are changes i need to for this.

    i done like this inside mouseDown() method
    Code:
                         var index = this.grid.getView().findRowIndex(t);
                       
                        var fieldName = this.grid.getColumnModel().getDataIndex(index); 
                       
                        var ind = this.grid.getColumnModel().findColumnIndex(fieldName);
                        
                        var record = this.grid.store.getAt(ind);
    
                        record.set(ind, !record.data[ind]);
    please help me.
    Last edited by mystix; 23 Jul 2008 at 10:35 PM. Reason: post code in [code][/code] tags. refer to http://extjs.com/forum/misc.php?do=bbcode

  8. #8
    Ext User
    Join Date
    Apr 2010
    Location
    Mumbai, India
    Posts
    12
    Vote Rating
    0
    snehap.1284 is on a distinguished road

      0  

    Default Single Cell Selection, Copy Paste in multiple cells in same gird

    Single Cell Selection, Copy Paste in multiple cells in same gird


    Hi,

    Even I have the same requirement

    I want to develop two things in an existing tree grid of our product:
    1. Single Cell Selection instead of rowselection. Copy it using Ctrl + C,
    2. Multi select cells in grid, Paste the copied value using Ctrl + V

    I wanted to know whether this is possible and how.

    Any links or examples on this will be appreciated

    Thanks in advance. Awaiting response

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi