Hibp.grid.tab = function(config) {
config = config || {};
Ext.applyIf(config,{
id: 'hibp-grid-tab'
,url: Hibp.config.connectorUrl // the php connector file which point to the php processors
,baseParams: { action: 'getlist.class' } // the php processor file to run and populate the grid
,fields: ['id','name','desc'] // add the fields we'll get from the AJAX request
,paging: true // add pagination
,remoteSort: true // allow columns to be sortable
,columns: [{
header: 'ID'
,dataIndex: 'id'
,sortable: true
,width: 60
},{
header: 'Name'
,dataIndex: 'name'
,sortable: true
,width: 100
},{
header: 'Description'
,dataIndex: 'desc'
,sortable: false
,width: 350
}]
});
Hibp.grid.tab.superclass.constructor.call(this,config)
};
Ext.extend(Hibp.grid.tab,MODx.grid.Grid); // change to MODx.grid.Grid
Ext.reg('hibp-grid-tab',Hibp.grid.tab); //register this component to its xtype
class HibpGetUserProcessor extends modProcessor { //modObjectGetListProcessor
public function process() {
$count = 1;
$array = array(
"id" => "8310024813",
"name" => "Joe Organizer",
"desc" => "Joe is the Organizerest Organizer."
);
return $this->outputArray($array,$count);
}
}
return 'HibpGetUserProcessor';
$count = 1; $array = array( "id" => "8310024813", "name" => "Joe Organizer", "desc" => "Joe is the Organizerest Organizer." ); $output = $this->outputArray($array,$count); return $output;
This question has been answered by markh. See the first response.
$array = array(
"id" => "8310024813",
"name" => "Joe Organizer",
"desc" => "Joe is the Organizerest Organizer."
);
return $this->outputArray($array,$count);
$items = array();
$items[] = array(
"id" => "8310024813",
"name" => "Joe Organizer",
"desc" => "Joe is the Organizerest Organizer."
);
return $this->outputArray($items,$count);