Results 1 to 2 of 2

Thread: Checkbox of CheckboxSelectionModel in Wrong Column!?

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    43

    Default Checkbox of CheckboxSelectionModel in Wrong Column!?

    Heya, community..!

    I'm encountering an unexpected problem. I have a grid with a CheckboxSelectionModel. I have a column with that model, too.. But it doesn't matter in which way I insert that column.. It's always shown as the second one. (After the first non-checkbox-column) But it should be the first one..!

    Here is my code:

    Definition of ColumnModel:

    Code:
        colModel: new Ext.grid.ColumnModel({
          columns: [{
            header: _("Name"),
            sortable: false,
            dataIndex: "name",
            id: "name"
          },{
            header: _("Path"),
            width: 450,
            sortable: false,
            dataIndex: "path",
            id: "path"
          },{
            header: _("Mode"),
            sortable: false,
            dataIndex: "mode",
            id: "mode"
         }]
        })
    The column "Name" is the first one shown in my grid.

    Now I'm appending my CheckboxSelectionModel and column a little later:

    Code:
        this.sm = new Ext.grid.CheckboxSelectionModel({
          singleSelect: false
        });
        this.colModel.columns.unshift(this.sm);
    As my code renders the grid, the selectbox is the second column. Even if unshift() should push it to the first index. I tried it with a ordinary column object to.. It becomes also only the second one.

    But why?

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    43

    Default

    Another approach, but same story. Could there be a special reason to prefer the "name" column in my grid?

    Code:
      
      var sm = new Ext.grid.CheckboxSelectionModel({singleSelect: false});
      var initialConfig = {
        sm: sm,
        colModel: new Ext.grid.ColumnModel({
          columns: [
            sm,
          {
            header: _("Name"),
            sortable: false,
            dataIndex: "name",
            id: "name"
          },{
            header: _("Path"),
            width: 450,
            sortable: false,
            dataIndex: "path",
            id: "path"
          },{
            header: _("Mode"),
            sortable: false,
            dataIndex: "mode",
            id: "mode"
         }]
        })
      };
    Edit:

    If I remove the "name" column, the checkbox column becomes the first one.

Posting Permissions

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