1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    matscher is on a distinguished road

      0  

    Default Ext.Direct Paging Grid - No Data to Display

    Ext.Direct Paging Grid - No Data to Display


    Hi,
    I trie to connect a PagingToolBar to a Grid. But the grid always says: "No Data to Display".

    Who can help me to solve this problem?

    My query.php:
    Code:
    public function getResults(stdClass $params)
        {        
            $_db = $this->__construct();
        
            $start  = isset($_REQUEST['start'])  ? $_REQUEST['start']  :  0;
            $count  = isset($_REQUEST['limit'])  ? $_REQUEST['limit']  : 30;  
          
            $_result = $_db->query("SELECT * FROM ws_import LIMIT ".$start.",".$count); 
    
            $results = array();  
            $results['total'] = 1343; //$totalResults; 
        
            $temp_array = array();
        
            $results['success']=true;
        
            while ($row = $_result->fetch_assoc())
            {
                array_push($temp_array, $row);
            }
            
           $results['records'] = $temp_array;
           
            return $results;
    
        }
    The server response:
    Code:
    {"type":"rpc","tid":1,"action":"QueryDatabase","method":"getResults","result":{"total":1343,"success":true,"records":[{"id":"10304023"....

    Thank you!

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    matscher is on a distinguished road

      0  

    Default


    Ok, I solved it. Here's the correct query.php:

    Code:
        public function getResults(stdClass $params)
        {
                    $_db = $this->__construct();
    
        $start = $params->start;
        $limit = $params->limit;
    
        $allRows = $_db->query("SELECT * FROM ws_import");
    
    //        $_result = $_db->query("SELECT id, created_at, updated_at, date_at FROM ws_import ") or die('Connect Error (' . $_db->connect_errno . ') ' . $_db->connect_error);
        $_result = $_db->query("SELECT id, created_at, updated_at, date_at, customer_id, customer_name, project_id, project_name, service_id, service_name, user_id, user_name, minutes, billable, locked, revenue, note FROM ws_import where customer_id = 54613 LIMIT ".$start.",".$limit) or die('Connect Error (' . $_db->connect_errno . ') ' . $_db->connect_error);
            
        $results = array();   //Ergebnisarray
                
        $results['success'] = true;
        $results['total'] = $allRows->num_rows; 
        
        $temp_array = array();
            
        //Ergebnisse in Ergebnissarray speichern
            while ($row = $_result->fetch_assoc()) {
                array_push($temp_array, $row);
            }
        
        $results['records'] = $temp_array;
        
            return $results;
        
        //Ressourcen freigeben
        $results->close();
        }