<?php 
include_once("_dirinfo.php");
include_once(PATH_TO_ROOT."init.php");
include_once(PATH_TO_ROOT."_class/class.Extjs_grid.php");
include_once(PATH_TO_ROOT."_class/class.Extjs_form.php");

    $tabId = $_POST['uniqueTabId'];
    $tabTitle = $_POST['name'];
    
    define(REQ_URL, "webuserspool/_ajax/panelistsOverview/ajax.inactivePanelists.php");
    
    // ############################################### MAIN GRID ##################################################################
    $grid = new MakeGrid($tabId);
    $grid->setCheckBoxSelectionModel();
    $grid->setReqUrl(REQ_URL)
        ->setFiltering();
    $grid->addColumn('id','ID')->hidden(true);
    $grid->addColumn('email', 'Email')->width(250)->table('a');
    $grid->addColumn('points', 'Points', 'new Ext.form.TextField()')->width(50)->type('int');
  /*  $grid->addColumn('proj_name', "Project")->width(150)->addSummaryRenderer("function(v, params, data){
                    return ((v === 0 || v > 1) ? '<b>(' + v +' Projects)<b>' : '<b>(1 Project)<b>');
                }")->addSummaryType('count');
    $grid->addColumn('webPoints', 'Web points')->table('d')->type('int')->tableAs('d')->width(80)->addSummaryType('sum');*/
    $grid->addSummaryGroup();
    $grid->setPaging(30);
    $grid->addConfig('region', '"center"');
    $grid->addtBarItem("'->'");
    $grid->setSearchField();
    
    echo $grid->createGrid();
    echo $grid->getName() . ".on('afteredit', function(e){
        e.grid.getStore().reload();
        var activeGrid = Ext.getCmp('panelistsOverview');
        if(activeGrid)
            activeGrid.getStore().reload();
    });";
    
    
    // ############################################### MAIN ################################################################## 
  
   echo " var " . $tabId . "_mainPanel = new Ext.Panel({
        id:'" . $tabId . "_mainPanel',
        title:'Inactive panelists',
        defaults:{split:true,border:false},
        layout:'border',
        border: false,
        closable:true,
        items:[$grid ]
    });
    
    mainTabPanel.add(" . $tabId . "_mainPanel ).show();  
    //Ext.getCmp('" . $tabId . "_propertiesPanel').add($detailsGrid).show();
    ";
  //  echo $purposeGrid .".getStore().load();";
?>