Hi
I’ve created custom manager page that returns data from table.
How can I use MODExt to show and edit that?
I found this code in documentation:
MyComponent.grid.MyGrid = function( config ) {
config = config || {};
/* Grid configuration options */
Ext.applyIf( config, {
id : "mycomponent-grid-mygrid",
title : _( "my_grid" ),
url : MyComponent.config.connectors_url + "list.php",
baseParams : {
action : "getlist"
},
paging : true,
autosave : true,
remoteSort : true,
/* Store field list */
fields : [ {
name : "id",
type : "int"
}, {
name : "name",
type : "string"
}, {
name : "menu"
} ],
/* Grid ColumnModel */
columns : [ {
header : _( "id" ),
dataIndex : "id",
sortable : true
}, {
header : _( "name" ),
dataIndex : "name",
sortable : true
} ],
/* Top toolbar */
tbar : [ {
xtype : "button",
text : _( "create" ),
handler : {
xtype : "mycomponent-window-create",
blankValues : true
},
scope : this
} ]
} );
/* Class parent constructor */
MyComponent.grid.MyGrid.superclass.constructor.call( this, config );
};
Ext.extend( MyComponent.grid.MyGrid, MODx.grid.Grid, {
/* Class members will go here */
} );
/* Register "mycomponent-grid-mygrid" as an xtype */
Ext.reg( "mycomponent-grid-mygrid", MyComponent.grid.MyGrid );
but I don’t know where to place this js and how to connect it...
Help!)