Author Topic: Ext xtype: 'checkcolumn' gak ada listeners-nya?  (Read 5036 times)

0 Members and 1 Guest are viewing this topic.

Offline goldsky

  • tweets @_goldsky
  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +1/-0
  • Less is more
    • Virtudraft Intermedia Telematika
Ext xtype: 'checkcolumn' gak ada listeners-nya?
« on: May 14, 2013, 04:30:39 AM »
Halo temans,

Saya ada problem serieus, nih.
Saya lagi bikin grid di CMP, trus mau pake checkbox (plugin) buat gridnya.
Tapi listeners-nya kok gak ke panggil, ya? ada yang bisa bantu?

Code: (javascript) [Select]
        columns: [{
                header: _('id'),
                dataIndex: 'id',
                sortable: true,
                hidden: true,
                width: 40
            }, {
                xtype: 'checkcolumn',
                header: _('active'),
                tooltip: _('active'),
                dataIndex: 'active',
                sortable: false,
                width: 30,
                editor: {
                    xtype: 'checkbox',
                    cls: 'x-grid-checkheader-editor'
                },
                listeners: {
                    'checkchange': {
                        fn: function(column, recordIndex, checked) {
                            console.log('column', column);
                            console.log('recordIndex', recordIndex);
                            console.log('checked', checked);
                        },
                        scope: this
                    },
                    'mousedown': {
                        fn: function() {
                            console.log('mousedown');
                        },
                        scope: this
                    }
                }
            }],

TIA
Rico
Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!

Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets | IE 6 must die !

Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

PING ME ON TWITTER @_goldsky

Offline goldsky

  • tweets @_goldsky
  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +1/-0
  • Less is more
    • Virtudraft Intermedia Telematika
Re: Ext xtype: 'checkcolumn' gak ada listeners-nya?
« Reply #1 on: May 14, 2013, 06:24:38 AM »
Sigh...
ujung2-nya saya cuma override methodnya aja
Code: (javascript) [Select]
        columns: [{
                header: _('id'),
                dataIndex: 'id',
                sortable: true,
                hidden: true,
                width: 40
            }, {
                xtype: 'checkcolumn',
                header: _('active'),
                tooltip: _('active'),
                dataIndex: 'active',
                sortable: false,
                width: 30,
                processEvent : function(name, e, grid, rowIndex, colIndex){
                    if (name === 'mousedown') {
                        var record = grid.store.getAt(rowIndex);
                        record.set(this.dataIndex, !record.data[this.dataIndex]);
                        MODx.Ajax.request({
                            url: Doodles.config.connectorUrl,
                            params: {
                                action: 'mgr/doodles/updateFromGrid',
                                data: JSON.stringify(record.data)
                            },
                            listeners: {
                                'success': {
                                    fn: function(){
                                        Ext.getCmp('doodles-grid-doodle').refresh();
                                    }
                                }
                            }
                        });
                        return false;
                    } else {
                        return Ext.grid.ActionColumn.superclass.processEvent.apply(this, arguments);
                    }
                }
            }]
Rico
Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!

Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets | IE 6 must die !

Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

PING ME ON TWITTER @_goldsky

Offline vanessa san

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Ext xtype: 'checkcolumn' gak ada listeners-nya?
« Reply #2 on: September 15, 2016, 01:40:49 AM »
hmmmm gak tau juga...sorry bro, gk pernah ngalami seperti itu  :-[
selalu semangat dan menikmati hidup ini

http://downloadbbmforandroid.net/

Offline aria34

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • Jasa SEO Jakarta
Re: Ext xtype: 'checkcolumn' gak ada listeners-nya?
« Reply #3 on: July 19, 2017, 10:01:32 PM »
Bah simple juga sih cara fix-nya hahah kriain harus rombak beberapa bagian code yang saling sambung. Awal uda mikir nih salah dimana, coba dan coba ttp sama eh gak taunya gampang wkwkwk
DADUWEB - Penyedia Jasa Pembuatan Toko Online dan Website untuk Bisnis Anda.

Offline FLou91

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
  • Wolololo
    • Download Applikasi Keuangan PAYFAZZ
Re: Ext xtype: 'checkcolumn' gak ada listeners-nya?
« Reply #4 on: February 28, 2018, 12:10:50 AM »
Fix-nya simple juga, karena salah line code. Harusnya gak terjadi sih kalau kita uda compare 2 line terakhir haha Tapi thanks buat insightnya, TS :)
Jual Pulsa Bisnis Sampingan yang Menguntungkan Selain Ngoding Pakai ModX!

 

term