1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    39
    Vote Rating
    0
    rTankersley is on a distinguished road

      0  

    Default Answered: Grid and Checkbox problem

    Answered: Grid and Checkbox problem


    I'm having two problems with grids. First, I'm trying to add a checkbox to it. However, it is adding two rows of checkboxes, rather than just one I have no idea why. Here is the grid code:

    Code:
    var sm = Ext.create('Ext.selection.CheckboxModel');
    Ext.define('ModuleHome.view.grids.threadListGrid', {
    	extend: 'Ext.grid.Panel',
    	alias: 'widget.threadListGrid',
    	forceFit: true,
            store: 'threadListStore',
    	title: 'List of Threads',
    	selModel: sm,
    	columns: [
    		{header: 'Title', dataIndex: 'title'},
    		{header: 'Author', dataIndex: 'author'},
    		{header: 'Created', dataIndex: 'created'},
    		{header: 'Number of Replies', dataIndex: 'replies'}
    	]
    });
    Secondly, I'm having an error where the grid's information does not show up at the beginning. It has the column headers, but no data. However if I open/close a firebug console, it shows up! It does this when autoloading or loaded manually at launch. Firebug shows a call to the server for information, even when the data is not showing. Then I close firebug and magically the information shows up!

    Anyway know why this could be?

  2. 1) Try removing the first list, and change selModel: sm to

    Code:
    selType: 'checkboxmodel',
    2) Is the store 'threadListStore' set up before you define the grid?
    2a) I get what you're trying to do in establishing a more encapsulated view in the grid definition, but usually you see stores and columns defined when you create an instance instead of defining the subclass. Can you try referencing the store id when you create the grid instead of when you define it and see if anything changes?
    2b) I'm wondering if declaring a Store AND a column set is causing problems, as columns are usually defined on the store.

    stevil

  3. #2
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Answers
    15
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    1) Try removing the first list, and change selModel: sm to

    Code:
    selType: 'checkboxmodel',
    2) Is the store 'threadListStore' set up before you define the grid?
    2a) I get what you're trying to do in establishing a more encapsulated view in the grid definition, but usually you see stores and columns defined when you create an instance instead of defining the subclass. Can you try referencing the store id when you create the grid instead of when you define it and see if anything changes?
    2b) I'm wondering if declaring a Store AND a column set is causing problems, as columns are usually defined on the store.

    stevil

  4. #3
    Sencha User
    Join Date
    May 2011
    Posts
    39
    Vote Rating
    0
    rTankersley is on a distinguished road

      0  

    Default


    I got it figured out. I wasn't ever declaring a height or anything to help with it. I guess firebug was changing the height, making the grid rethink its idea on how much room it had, and adjusting to where it was showing. Silly mistake that took a couple of hours of frustration, but solved now!

    Thanks for your help, especially on the checkbox model thing. Strangely just following the code in the examples, which is what I did, didn't work.

  5. #4
    Sencha User
    Join Date
    Feb 2010
    Posts
    125
    Answers
    7
    Vote Rating
    3
    börn is on a distinguished road

      0  

    Default


    I also have the problem that in one case I've two columns for the checkboxmodel. Does anyone know, why this happens?

    My config is:

    Code:
    {
          xtype: 'mygrid',
          padding:'0 0 10 0',
          storePath:field.name,
          columns:subModel.widgetConfig,
          tbar:subModel.actions,
          selModel :  {
            selType: 'checkboxmodel',
            mode: 'MULTI'
          }
        }
    I suppose it has something to do with my call to reconfigure of the grid... so i declared my grid with a checkboxmodel selection model at first and without a store, then somewhat later, i add my store to the grid by calling reconfigure. After that i see two checkbox columns

  6. #5
    Sencha User
    Join Date
    Feb 2010
    Posts
    125
    Answers
    7
    Vote Rating
    3
    börn is on a distinguished road

      0  

    Default


    okay it's a bug... with version 4.1-b2 everything works fine.

Thread Participants: 2

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..."