Author Topic: CMP modx  (Read 4055 times)

0 Members and 1 Guest are viewing this topic.

Offline crackers

  • Administrator
  • Full Member
  • *****
  • Posts: 166
  • Karma: +0/-0
CMP modx
« on: June 20, 2015, 12:27:59 PM »
Hehehehhe ceritanya Gwe belajar membuat CMP di modx revolution. Karena awam dengan EXTJS yang sangat ribet jadinya begini setelah belajar sendiri sesuai dengan

Quote
http://rtfm.modx.com/revolution/2.x/case-studies-and-tutorials/developing-an-extra-in-modx-revolution-modx-2.1-and-earlier

dan menggunakan reverse enginering

Quote
http://modx-id.com/references/tutorial/custom-database-part-1-data-schema-snippet-dan-chunk.html

masih mengalami kesalahan ternyat setelah bertanya kepada master wanita modx-er (reisharanty) dan dibantu oleh modx-master (goldsky) ternyata ada pada

Quote
$this->modx->addPackage('namapackage', $this->config['modelPath'], $modx->config[modX::OPT_TABLE_PREFIX] . 'tableprefix_di reverse enginering');

namun setelah itu kembali mengalami masalah yaitu

  • Gimana jika ada 2 table berelasi dan table lain sebagai foreign key pas input kita masukan ke kombo dan pas edit bisa ke load sesuai datanya di database pada form edit

    Karena dah tak coba pake code
    Quote

    Strukturorganisasi.combo.Parent = function(config) {
        config = config || {};
        Ext.applyIf(config,{
          url: Strukturorganisasi.config.connectorUrl
          ,baseParams: {
                action: 'getParent'
            }
            ,fields: ['id','name']
            ,displayField: 'name'
            ,valueField: 'id'
          ,lazyRender : true
        });
        Strukturorganisasi.combo.Parent.superclass.constructor.call(this,config);
    };
    Ext.extend(Strukturorganisasi.combo.Parent,MODx.combo.ComboBox);
    Ext.reg('strukturorganisasi-combo-parent',Strukturorganisasi.combo.Parent);

    Datanya ga masuk juga pas Add


  • Gimana Implementasi problem no 1 pada Grid
  • Gimana Caranya klo pengen inser, update dan delete secara manual.....(alias pake query)

Mohon pencerahan para master...........
« Last Edit: June 20, 2015, 02:19:12 PM by crackers »

Offline crackers

  • Administrator
  • Full Member
  • *****
  • Posts: 166
  • Karma: +0/-0
Re: CMP modx
« Reply #1 on: June 20, 2015, 09:33:48 PM »
Perkembangan....... sudah ketemu biar masuk ke dbnya

yang dibold adalah solusinya pas gwe pake cuma name ga bisa ternyata harus ada hiddenName

Quote
Strukturorganisasi.combo.Parent = function(config) {
    config = config || {};
    Ext.applyIf(config,{
      url: Strukturorganisasi.config.connectorUrl
      ,baseParams: {
            action: 'getParent'
        }
        ,fields: ['id','name']
        ,displayField: 'name'
        ,valueField: 'id'
      ,allowBlank: true
      ,mode: 'remote'
      ,emptyText : 'Select The Parent'
      ,queryMode:'remote'
      ,editable:true
      ,name : 'id_parent'
      ,hiddenName : 'id_parent'

    });
    Strukturorganisasi.combo.Parent.superclass.constructor.call(this,config);
};
Ext.extend(Strukturorganisasi.combo.Parent,MODx.combo.ComboBox);
Ext.reg('strukturorganisasi-combo-parent',Strukturorganisasi.combo.Parent);

Sekarang ada lagi muncul masalah selain pertanyaan yang belum terjawab diatas yaitu pas sudah add dan munculin lagi window formnya data di combonya ga nge load data yang baru yah????.....

Ditunggu Responsenya para suhu
« Last Edit: June 20, 2015, 10:09:35 PM by crackers »

Offline goldsky

  • tweets @_goldsky
  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +1/-0
  • Less is more
    • Virtudraft Intermedia Telematika
Re: CMP modx
« Reply #2 on: June 25, 2015, 10:11:55 AM »
bro crackers, coba jajal begini:

Code: (javascript) [Select]
    loadWindow: function(btn,e) {
        var win = MODx.load({
            xtype: 'nama-xtype-window-nya',
            record: this.menu.record,
            title: _('title'),
            baseParams: {
                action: 'path/to/create'
            },
            listeners: {
                'success': {
                    fn:this.refresh,
                    scope:this
                }
            }
        });
        win.setValues(this.menu.record);
        win.show(e.target);
    },

this.menu.record itu value dari baris grid waktu di-right-click.
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: CMP modx
« Reply #3 on: June 26, 2015, 08:14:40 PM »
Atau:

win.fp.getForm().reset()
win.show(e.target)
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 crackers

  • Administrator
  • Full Member
  • *****
  • Posts: 166
  • Karma: +0/-0
Re: CMP modx
« Reply #4 on: June 27, 2015, 01:47:22 AM »
ahayyyyy gwe bingung  hahahhaha

ini code gwe untuk tombol add

Quote
,tbar:[{
         xtype: 'textfield'
         ,id: 'strukturorganisasi-search-filter'
         ,emptyText: _('strukturorganisasi.search')
         ,listeners: {
            'change': {fn:this.search,scope:this}
            ,'render': {fn: function(cmp) {
               new Ext.KeyMap(cmp.getEl(), {
                  key: Ext.EventObject.ENTER
                  ,fn: function() {
                     this.fireEvent('change',this);
                     this.blur();
                     return true;
                  }
                  ,scope: cmp
               });
            },scope:this}
         }
      }
      ,{
         text: _('strukturorganisasi.create')
         ,handler: { xtype: 'strukturorganisasi-window-strukturorganisasi-create' ,blankValues: true }
      }]

ini code gwe buat window formnya

Quote
Strukturorganisasi.window.CreateStrukturorganisasi = function(config) {
    config = config || {};
    Ext.applyIf(config,{
        title: _('strukturorganisasi.create')
        ,url: Strukturorganisasi.config.connectorUrl
        ,baseParams: {
            action: 'create'
        }
      ,listeners: {
         'success': {fn:this.refresh,scope:this}
      }
        ,fields: [{
            xtype: 'textfield'
            ,fieldLabel: _('strukturorganisasi.name')
            ,name: 'name'
            ,anchor: '100%'
        },{
            xtype: 'textarea'
            ,fieldLabel: _('strukturorganisasi.description')
            ,name: 'description'
            ,anchor: '100%'
        },{
            xtype: 'strukturorganisasi-combo-parent'
            ,fieldLabel: _('strukturorganisasi.parent')
            ,name: 'id_parent'
            ,anchor: '100%'
        },{
            xtype: 'strukturorganisasi-combo-junction'
            ,fieldLabel: _('strukturorganisasi.junction')
            ,name: 'junc'
            ,anchor: '100%'
        }]
    });
    Strukturorganisasi.window.CreateStrukturorganisasi.superclass.constructor.call(this,config);
};
Ext.extend(Strukturorganisasi.window.CreateStrukturorganisasi,MODx.Window);
Ext.reg('strukturorganisasi-window-strukturorganisasi-create',Strukturorganisasi.window.CreateStrukturorganisasi);

Setelah add dan window ke close kita mau add lagi pengenya data di combonya ke load data yang baru gitu......sekarang pas add dan close kemudian add lagi data di combonya ga muncul data baru, kira2 dia apanya yah para suhu?
« Last Edit: June 27, 2015, 01:58:58 AM by crackers »

Offline goldsky

  • tweets @_goldsky
  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +1/-0
  • Less is more
    • Virtudraft Intermedia Telematika
Re: CMP modx
« Reply #5 on: July 09, 2015, 08:42:48 PM »
coba di window-nya ditambahin config
Code: [Select]
,closeAction: 'close'
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