Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: EditorGridPanel: What did i miss?

  1. #11
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    You don't want a Ext.grid.CheckboxSelectionModel, you want an Ext.ux.grid.CheckColumn (in examples/ux/CheckColumn.js).

  2. #12
    Sencha User trasherdk's Avatar
    Join Date
    Dec 2008
    Location
    Thailand
    Posts
    42
    Vote Rating
    1
      0  

    Thumbs up Thanks. That just did it.

    Condor, once again, spot on

    How ever, it does make me wonder. What is the CheckboxSelectionModel for then ??

    I managed to get my calculated column by adding the following to the store:
    Code:
    	,{name: 'total',	type: 'float',		mapping: 'unit * obj.price'}
    It's a readonly column, and none of the columns will be sortable.

    Next exercise is to get my combobox in the product column, and
    make the grid "editable".

    Thanks a lot for your help.

    Regards
    Mogens
    Attached Images Attached Images

  3. #13
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    CheckboxSelectionModel was created to simplify multiple row selection and it should be used as both the selection model and as the first column.

    If the checkbox column isn't be editable then you should only use the renderer of the CheckColumn.

    Note: If you use a mapping to calculate the total then it won't automatically update if unit or price changes.

  4. #14
    Sencha User trasherdk's Avatar
    Join Date
    Dec 2008
    Location
    Thailand
    Posts
    42
    Vote Rating
    1
      0  

    Thumbs up

    Condor, thanks.

    I'll probably implement your "Calculated fields" extension later, when i
    get the other issues under control.

    So far the checkbox seem to work as editable, but i haven't implemented
    the writer, or add functions yet.

    I'm not used to program front-end, so this learning curve seem rather steep

    Anyway, this extjs thing is soo cool that it's worth the time

    Regards
    Mogens

  5. #15
    Sencha - Ext JS Dev Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,056
    Vote Rating
    19
      0  

    Default

    Code:
    { header: 'Total', dataIndex: 'id', renderer: function(value, p, r) { return +r.data.units * +r.data.price; } }

  6. #16
    Sencha User trasherdk's Avatar
    Join Date
    Dec 2008
    Location
    Thailand
    Posts
    42
    Vote Rating
    1
      0  

    Thumbs up

    mschwartz, cool.

    That's working, and is updating when unit or price change.

    Code:
    { header: 'Total', dataIndex: 'id'
    , renderer: function(value, p, r) { return +r.data.units * +r.data.price; }
    }
    I got a "NaN" in the total column, until i spotted the extra s in unit

    Thanks

    Mogens

  7. #17
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    Also a good solution, the only advantage that a calculated field has over this is that it is sortable.

Page 2 of 2 FirstFirst 12

Posting Permissions

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