1. #11
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      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
    0
    trasherdk is on a distinguished road

      0  

    Thumbs up Thanks. That just did it.

    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

  3. #13
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      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
    0
    trasherdk is on a distinguished road

      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 - Community Support Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,053
    Vote Rating
    17
    mschwartz will become famous soon enough mschwartz will become famous soon enough

      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
    0
    trasherdk is on a distinguished road

      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,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar