Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 48

Thread: Visible Checkbox in EditorGrid

  1. #21

    Default

    Just what i was looking for, many thanks...

  2. #22
    Sencha User
    Join Date
    Jun 2007
    Location
    Bourges (France)
    Posts
    106

    Default

    I write this code
    function getColumnModel() {

    if(!columnModel) {
    columnModel = new Ext.grid.ColumnModel([

    {id:'req1',header: "Code", width: 100, sortable: true, dataIndex: 'code_lib',
    editor: new Ext.grid.GridEditor(new Ext.form.TextField({
    allowBlank: false
    }))
    },

    {header: "Libelle", width: 250, sortable: true, dataIndex: 'lib',
    editor: new Ext.grid.GridEditor(new Ext.form.TextField({
    allowBlank: false
    }))
    },
    {header: "Libelle US", width: 250, sortable: true, dataIndex: 'lib_us',
    editor: new Ext.grid.GridEditor(new Ext.form.TextField({
    allowBlank: false
    }))
    },
    {header: 'Supprimer',sortable: true,dataIndex:'suppr',align: 'center',width: 30,renderer: formatBoolean,editor: false}
    ]);
    }

    return columnModel;
    }
    But my column with the checkbox is systematicly with a width = 250 px
    Despite I specified width:30 in the config options


    Nothing in my css influence that.
    It's very strange.

  3. #23
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    Quote Originally Posted by Footeuz View Post
    I write this code


    But my column with the checkbox is systematicly with a width = 250 px
    Despite I specified width:30 in the config options


    Nothing in my css influence that.
    It's very strange.
    that's completely off-topic.
    either post in an existing thread with a topic related to your question, or start a new thread.

    [edit]
    p.s. have you checked your img width?

  4. #24
    Sencha User
    Join Date
    Jun 2007
    Location
    Bourges (France)
    Posts
    106

    Default

    I'm using all the code off this topic for the column with a checkbox so...
    My image width is 20px

  5. #25
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    for starters, it's editable:false, not editor:false
    Code:
    {header: 'Supprimer',sortable: true,dataIndex:'suppr',align: 'center',width: 30,renderer: formatBoolean,editable: false}
    also, your columnModel variable is global, since you didn't var it.

    what about your css?
    is there anything saying class "checkbox" should be 250px wide?

  6. #26
    Sencha User
    Join Date
    Jun 2007
    Location
    Bourges (France)
    Posts
    106

    Default

    Thanks.
    I copy the example with this mistake...

    No when I try to put a width for the class checkbox. its change the width of the image. And not the cell.

    Edit : I found the solution. on my grid there was the line : autoSizeColumns: true,
    And its adjust the width of my checkbox column

  7. #27
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    Quote Originally Posted by Footeuz View Post
    Thanks.
    I copy the example with this mistake...

    No when I try to put a width for the class checkbox. its change the width of the image. And not the cell.

    Edit : I found the solution. on my grid there was the line : autoSizeColumns: true,
    And its adjust the width of my checkbox column
    post your full test case.

    i have no idea which "example" you're using.


    [edit]
    other than the autoSizeColumns config, you should also watch out for the autoExpandColumn config

  8. #28

    Default

    i add a checkbox on the header
    Code:
        var cm = new Ext.grid.ColumnModel([{
    
    		  header:'<input type="checkbox" />',
    		  dataIndex: 'ch',
    		  width: 30,
    		  renderer: formatBoolean,
    		  editable: false,
    		  sortable:0
    		},{
    when i click the checkbox,all select or unselect,what can i do?

  9. #29
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    Quote Originally Posted by followmephoe View Post
    i add a checkbox on the header
    Code:
        var cm = new Ext.grid.ColumnModel([{
    
    		  header:'<input type="checkbox" />',
    		  dataIndex: 'ch',
    		  width: 30,
    		  renderer: formatBoolean,
    		  editable: false,
    		  sortable:0
    		},{
    when i click the checkbox,all select or unselect,what can i do?
    what do you mean by "what can i do"?

    [edit]
    did you mean "how do i do it"?

  10. #30

    Default

    说个中国话吧,就是我要怎么实现这个功能?

Page 3 of 5 FirstFirst 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •