Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    14
    Vote Rating
    0
    ciw1973 is on a distinguished road

      0  

    Default [FIXED-186] Not Including CheckboxSelectionModel In Column Model

    [FIXED-186] Not Including CheckboxSelectionModel In Column Model


    When adding a CheckboxSelectionModel to a grid it looks fine in the designer, but when the exported project is run in the browser the checkbox column is missing because it's not being included in the column model.

    I appreciate that this can't be done using entirely declarative syntax as you need two references (selModel and a column) to the same selection model, so the exported .ui.js code would need to declare the column model before the main object and then reference it in the declaration.

    Currently I'm having to add the code below to the corresponding .js file after initialization, which is hardly a major pain, more a minor irritation.

    Code:
    this.MyGrid.colModel.config.unshift(this.MyGrid.selModel);

  2. #2
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    That's actually not true, the selModel is included in the exported code. It is identical to the code you see generated in the Code->Class tab:

    Code:
    /*
     * File: MyGrid.ui.js
     * Date: Thu Jul 15 2010 23:22:55 GMT-0400 (EDT)
     * 
     * This file was generated by Ext Designer version xds-1.0.2.5.
     * http://www.extjs.com/products/designer/
     *
     * This file will be auto-generated each and everytime you export.
     *
     * Do NOT hand edit this file.
     */
    
    MyGridUi = Ext.extend(Ext.grid.GridPanel, {
        title: 'My Grid',
        width: 400,
        height: 250,
        initComponent: function() {
            this.selModel = new Ext.grid.CheckboxSelectionModel({
    
            });
            this.columns = [
                this.selModel,
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'string',
                    header: 'Column',
                    sortable: true,
                    width: 100
                },
                {
                    xtype: 'numbercolumn',
                    dataIndex: 'number',
                    header: 'Column',
                    sortable: true,
                    width: 100,
                    align: 'right'
                },
                {
                    xtype: 'datecolumn',
                    dataIndex: 'date',
                    header: 'Column',
                    sortable: true,
                    width: 100
                },
                {
                    xtype: 'booleancolumn',
                    dataIndex: 'bool',
                    header: 'Column',
                    sortable: true,
                    width: 100
                }
            ];
            MyGridUi.superclass.initComponent.call(this);
        }
    });
    This has been the case since version 1.0.2.1, released a week ago.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    14
    Vote Rating
    0
    ciw1973 is on a distinguished road

      0  

    Default Definitely not working for me

    Definitely not working for me


    I'm running v1.0.2.5 and whilst the checkbox column does show correctly in the code preview, it's missing in the generated .ui.js file. I guess this explains why it appears up on the design surface but not the designer preview or the browser.

    As I'm working on an old project which was created with v1.0.1, I've just created a new minimal project but it still doesn't work.

    I've attached this quick test project which is missing things like a store etc., but you'll see that the problem is still there for me.
    Attached Files

  4. #4
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    True enough, thanks ciw1973. As a workaround, you can do a "Promote to Class" on your GridPanel. When the GridPanel is a root component, the selModel will properly be added into the column model, as you see in my code segment above. It becomes quite tricky when the GridPanel is a JSON configured child item of some other component. I will figure out a solution to this however.

    Thanks again!

  5. #5
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goias, Goiânia
    Posts
    431
    Vote Rating
    6
    wemerson.januario is on a distinguished road

      1  

    Default


    When we add a checkbox SelModel, in designer appear to be ok. But when we test in the real application it does not appers.
    Ok. if I add this
    Code:
    this.grid.colModel.config[0]= this.grid.selModel;
    it works .
    But the config on position[1] destroy. Why?

    I am fixing this using this.
    this.grid.colModel.config.unshift(this.grid.selModel);
    is it the better Way?
    Last edited by wemerson.januario; 22 Jul 2010 at 6:16 AM. Reason: solution
    Wemerson Januario
    Twitter:
    @wemersonjanuar
    Skype:
    wemerson.januario
    Email: wemerson.januario@gmail.com
    Fone:
    62 9106-6689
    From: Goiânia, Brazil
    Desenvolvedor ExtJS/ ExtJS Developer

  6. #6
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    Yes use unshift(), it will append the selModel to the beginning of the colModel config instead of overwriting the first index.

    If it isn't showing up in the real application, did you do what I suggested? That is, did you promote the GridPanel to a class of its own? If you do that, it will generate the proper code and work for you.

  7. #7
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goias, Goiânia
    Posts
    431
    Vote Rating
    6
    wemerson.januario is on a distinguished road

      0  

    Default ok

    ok


    Quote Originally Posted by jarrednicholls View Post
    Yes use unshift(), it will append the selModel to the beginning of the colModel config instead of overwriting the first index.

    If it isn't showing up in the real application, did you do what I suggested? That is, did you promote the GridPanel to a class of its own? If you do that, it will generate the proper code and work for you.
    Thanks Jarred.
    Wemerson Januario
    Twitter:
    @wemersonjanuar
    Skype:
    wemerson.januario
    Email: wemerson.januario@gmail.com
    Fone:
    62 9106-6689
    From: Goiânia, Brazil
    Desenvolvedor ExtJS/ ExtJS Developer

  8. #8
    Sencha User dotnetwise's Avatar
    Join Date
    Mar 2010
    Location
    Iasi, Romania
    Posts
    31
    Vote Rating
    1
    dotnetwise is on a distinguished road

      0  

    Default


    I have written a nicer work-around in the main (grid) class
    Code:
    Sen.search.Grid = Ext.extend(Sen.search.GridUi, {
    	initComponent: function () {
    		Sen.search.GridUi.superclass.initComponent = Sen.search.GridUi.superclass.initComponent.createInterceptor(function () {
    			this.columns.splice(0, 0, this.selModel);
    		}, this);
    		Sen.search.Grid.superclass.initComponent.call(this);
    	}
    });
    Last edited by dotnetwise; 29 Jan 2011 at 2:34 AM. Reason: formatted code

Similar Threads

  1. [FIXED-186] Documentation events for Ext.util.TapRepeater
    By deister in forum Sencha Touch 1.x: Bugs
    Replies: 1
    Last Post: 30 Jul 2010, 9:21 AM
  2. Ampersand in column model doesnt show in column header menulist?
    By aolee in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 19 Apr 2010, 2:31 AM
  3. Replies: 4
    Last Post: 21 Jul 2009, 8:39 AM
  4. Adding mouseover event to column in column model
    By shameed in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 28 Jun 2009, 4:46 PM
  5. Wrong height in Column Panel including a TabPanel
    By Dr.BuP in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 17 Jan 2008, 9:15 AM

Thread Participants: 3

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