1. #1
    Ext User albertixcom's Avatar
    Join Date
    Feb 2009
    Posts
    14
    Vote Rating
    0
    albertixcom is on a distinguished road

      0  

    Default Checkbox rendering - grid column

    Checkbox rendering - grid column


    I'm newbie, i've just started playing with extjs and I've applied edit-grid example to my database. I want to compliment for Your great big work !!!
    I've read API documentation but I think I have some miss because I can't make simple checkbox column (only for selection of records purpose) without use plugin.

    Code:
            //checkColumn
            {
               header: "select record",
               dataIndex: 'foo', // not relevant (not use in dabase)
               editor: new fm.Checkbox({ 
                autoShow : true
               })
            }
    .. strange, I see "true/false" strings instead of tipical checkboxes, what I miss ?

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,526
    Vote Rating
    378
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Why not to use CheckboxSelectionModel?
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  3. #3
    Ext User albertixcom's Avatar
    Join Date
    Feb 2009
    Posts
    14
    Vote Rating
    0
    albertixcom is on a distinguished road

      0  

    Default


    Thank's a lot for Your reply. Right, I've just tested this kind of solution and is exactly what i'm looking for.
    Thank You again.

    PS. In this moment I'm trying to switch my old static application (SMS gateway) to new EXTJS way. I'm planing to have unique interface with form and grid together where user can choise one or more customers to send sms message. Grid must be able to filter only mobile phones, some customers ecc (it's great tutorial on EXTJS support pages), editing, deleting eccc. Step in the future ... one interface for many features ...

  4. #4
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,526
    Vote Rating
    378
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    I wish you good luck! Keep us briefed on your progress and show us result then, if possible.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  5. #5
    Ext User albertixcom's Avatar
    Join Date
    Feb 2009
    Posts
    14
    Vote Rating
    0
    albertixcom is on a distinguished road

      0  

    Default


    Hi,
    Now I look around by google and forums to find solution for this problem:
    Code:
    data = [
     ('Smith','John','054111111','3333333'),
     ('White','Oscar','','444444'),
     ('Black','Peter','05414444','')]
    DataDescr: LastName,FirstName,Phone,Mobile

    On data.load checkbox apear only for "Smith and White" because mobile is not empty.
    How I can disable (disapear) only certain checkboxes on load data ? I found solution to read /put in data.store but I don't kno how interact im to hide checkbox.
    Sorry for my English.
    Alberto.

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Hide checkboxes on certain rows? Maybe you want Saki's rowactions plugin?

  7. #7
    Ext User albertixcom's Avatar
    Join Date
    Feb 2009
    Posts
    14
    Vote Rating
    0
    albertixcom is on a distinguished road

      0  

    Default


    Thanks fore reply,
    I've checked suggested plugin. Is great plugin, i have in mind for nex my implementation, but for my purpose is too much, I need only hide some checkboxes in column if some condition in row occur (in my case: if filed "mobile" is not empty)
    Alberto

  8. #8
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    maybe use a renderer then

  9. #9
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,526
    Vote Rating
    378
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Yeah, a custom renderer is the simplest way.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  10. #10
    Ext User albertixcom's Avatar
    Join Date
    Feb 2009
    Posts
    14
    Vote Rating
    0
    albertixcom is on a distinguished road

      0  

    Default


    I'm still disable solve previous problem : HIDE UNWANTED CHECKBOXES (on specific condition eg: field "mobile" empty)
    I've found at post:
    https://extjs.net/forum/showthread.php?p=267945
    this explain:
    [..]
    Disabling the checkbox is not supported with the current code. The checkboxes are rendered using CSS and images, not a true HTML input element. It would be possible to override the render methods in CheckColumnConfig to provide disabled support.
    [..]
    I've tryied also this solution without success.
    This is my simplified code:
    Code:
    Ext.onReady(function(){
    
        var myData = [
            [ 'Albert Einstein', '05411799999', '333333333' ],
            [ 'Albertino Einstein', '', '333334444' ],
            [ 'Alberta Einstein', '05411799997', '' ]
        ];
    
        Ext.QuickTips.init();
    
        var fm = Ext.form;
    
        var sm = new Ext.grid.CheckboxSelectionModel({
            renderer: foo
        });
        
        function foo()
        {
            return '<div class="x-grid3-row-checker">&nbsp;</div>';
        }
    
        var cm = new Ext.grid.ColumnModel([
            { id:'fullname', header: "Full Name", dataIndex: 'fullname', width: 220 },
            { header: "Telephone", dataIndex: 'tel', width: 120 },
            { header: "Mobile", dataIndex: 'cell', width: 120 },
            sm
        ]);
    
        var store = new Ext.data.SimpleStore({
            fields: [
               {name: 'fullname'},
               {name: 'tel'},
               {name: 'cell'}
            ]
        });
        
        var grid = new Ext.grid.EditorGridPanel({
            store: store,
            cm: cm,
            renderTo: 'editor-grid',
            width:600,
            height:300,
            title:'Genius Family',
            frame:true,
            sm: sm
        });
        store.loadData(myData);
    });
    I miss piece of how interface checking data with renderer:
    "If EMPTY record.data.cell THEN return '&nbsp;' " ...

    Thanks in advice.
    Alberto.