1. #1
    Sencha User
    Join Date
    Sep 2008
    Location
    vietnam
    Posts
    14
    Vote Rating
    1
    tcl_java is on a distinguished road

      0  

    Default Ext.ux.grid.CheckboxColumn

    Ext.ux.grid.CheckboxColumn


    Demo here
    Download


    PHP Code:
    Ext.ns('Ext.ux.grid');

    /**
     * A Column definition class which renders enum data fields.
     * @class Ext.ux.grid.CheckboxColumn
     * @extends Ext.grid.Column
     * @author Tran Cong Ly - tcl_java@yahoo.com - http://5cent.net
     * Create the column:
     *   
    var cm = new Ext.grid.ColumnModel([
    new Ext.ux.grid.CheckboxColumn({
        header: 'Header #1',
        dataIndex: 'field_name_1'
    },
    {
        xtype: 'checkboxcolumn',
        header: 'Header #2',
        dataIndex: 'field_name_2',
        on: 1,
        off: 0
    },
    {
        xtype: 'checkboxcolumn',
        header: 'Header #3',
        dataIndex: 'field_name_3',
        on: 'abc',
        off: 'def'
    }])
     
     */
    Ext.ux.grid.CheckboxColumn Ext.extend(Ext.grid.Column, {
        
    ontrue,
        
    offfalse,
        
    constructor: function (cfg) {
            
    Ext.ux.grid.CheckboxColumn.superclass.constructor.call(thiscfg);
            
    this.editor = new Ext.form.Field();
            var 
    cellEditor this.getCellEditor(),
                
    on this.on,
                
    off this.off;
            
    cellEditor.on('startedit', function (elv) {
                
    cellEditor.setValue(String(v) == String(on) ? off on);
                
    cellEditor.hide();
            });
            
    this.renderer = function (valuemetaDatarecordrowIndexcolIndexstore) {
                
    metaData.css += ' x-grid3-check-col-td';
                return 
    '<div class="x-grid3-check-col' + (String(value) == String(on) ? '-on' '') + '"></div>';
            }
        }
    });
    Ext.grid.Column.types['checkboxcolumn'] = Ext.ux.grid.CheckboxColumn
    Attached Files

  2. #2
    Ext User
    Join Date
    May 2009
    Posts
    8
    Vote Rating
    0
    sis9 is on a distinguished road

      0  

    Default


    use this:
    Code:
    this.editor = new Ext.grid.GridEditor(new Ext.form.Field());
    instead of:
    Code:
    this.editor = new Ext.form.Field();
    btw.thank you for sharing this code!
    Last edited by mystix; 13 Feb 2010 at 10:02 AM. Reason: POST CODE IN [code][/code] TAGS. see http://extjs.com/forum/misc.php?do=bbcode#code

  3. #3
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    3
    Vote Rating
    0
    hakonvik is on a distinguished road

      0  

    Default


    Or even better:

    Code:
    this.editor = new Ext.grid.GridEditor(new Ext.form.Checkbox());

  4. #4
    Ext User
    Join Date
    May 2009
    Posts
    8
    Vote Rating
    0
    sis9 is on a distinguished road

      0  

    Default


    if defined "on" and "off" parameters are others then true or false than you should use
    Code:
    this.editor = new Ext.grid.GridEditor(new Ext.form.Field());
    if defined "on" and "off" parameters are default true or false,
    and you do not want to see editor field, than use
    Code:
    this.editor = new Ext.grid.GridEditor(new Ext.form.Checkbox());

  5. #5
    Sencha User
    Join Date
    Sep 2008
    Location
    vietnam
    Posts
    14
    Vote Rating
    1
    tcl_java is on a distinguished road

      0  

    Default


    Quote Originally Posted by sis9 View Post
    if defined "on" and "off" parameters are others then true or false than you should use
    Code:
    this.editor = new Ext.grid.GridEditor(new Ext.form.Field());
    if defined "on" and "off" parameters are default true or false,
    and you do not want to see editor field, than use
    Code:
    this.editor = new Ext.grid.GridEditor(new Ext.form.Checkbox());
    Quote Originally Posted by sis9 View Post
    use this:
    Code:
    this.editor = new Ext.grid.GridEditor(new Ext.form.Field());
    instead of:
    Code:
    this.editor = new Ext.form.Field();
    btw.thank you for sharing this code!
    Thank so much!
    I will change it
    & sorry for my reply late

  6. #6
    Ext User
    Join Date
    May 2009
    Posts
    8
    Vote Rating
    0
    sis9 is on a distinguished road

      0  

    Default



  7. #7
    Ext User binoruv's Avatar
    Join Date
    Mar 2010
    Location
    Beijing
    Posts
    10
    Vote Rating
    0
    binoruv is on a distinguished road

      0  

    Default


    greate job, that helps me a lot!

    thanks tcl_java


  8. #8
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    303
    Vote Rating
    0
    talha06 is on a distinguished road

      0  

    Default


    this is really very useful extension.. Thanks a lot for sharing tcl_java.

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