TreeStore过程参数-EXTJS 4 这是extjs4传递参数groupid的方法 tree1.php

TreeStore过程参数-EXTJS 4 这是extjs4传递参数groupid的方法 tree1.php,php,javascript,extjs,extjs4,parameter-passing,Php,Javascript,Extjs,Extjs4,Parameter Passing,看起来正常,但外部参数:{'groupid':'2'},-->字符串 var store = Ext.create('Ext.data.TreeStore', { proxy: { type: 'ajax', autoLoad: true, url: 'tree1.php', extraParams :{groupid:'2'}, // Here Magic comes }, actionMethods: 'GET',

看起来正常,但
外部参数:{'groupid':'2'},
-->字符串

var store = Ext.create('Ext.data.TreeStore', {
        proxy: {
    type: 'ajax',
    autoLoad: true,
    url: 'tree1.php',
    extraParams :{groupid:'2'},
    // Here Magic comes
    },
    actionMethods: 'GET',
        sorters: [{
            property: 'leaf',
            direction: 'ASC'
                    }, {
            property: 'text',
            direction: 'ASC'
                    }]
    });
<?php
mysql_connect("localhost", "root", "") or die("Could not connect");
mysql_select_db("db_gps") or die("Could not select database");


$parent_id = $_GET['node'];
$group_id = $_GET['groupid'];

if ($parent_id > 0){

}else{
$parent_id = "0";   
}
    // 1) Remove false as checked
    if ($group_id > 0){
    $query = "SELECT * FROM (SELECT GroupID as id,GroupName as text,0 as parent_id FROM tbl_group UNION SELECT DeviceID as id,VehicleNo as text,GroupID as parent_id FROM Tbl_device) as u WHERE parent_id = '".$parent_id."' AND id= '".$group_id."' ORDER BY u.text ASC"; 
    }else{
    $query = "SELECT * FROM (SELECT GroupID as id,GroupName as text,0 as parent_id FROM tbl_group UNION SELECT DeviceID as id,VehicleNo as text,GroupID as parent_id FROM Tbl_device) as u WHERE parent_id = '".$parent_id."' ORDER BY u.text ASC"; 
    }


    $rs = mysql_query($query);
    $arr = array();
    while($obj = mysql_fetch_object($rs)) {

        $qq = mysql_query("SELECT * FROM tbl_device WHERE GroupID='". $obj->id ."'");

        if (mysql_num_rows($qq) > 0) {
            // if have a child
            //echo "have child";
            $obj->leaf = "false";
            //$obj->cls = 'folder';
        } else {
            // if have no child

            $obj->leaf = "true";
            //$obj->cls = 'file';
        }

      // 2) If no leaf then destroy the attribute
      if($obj->leaf != "false"){
         // 1) set checked attribute with an boolean value 
         $obj->checked = false;       
      }
     $arr[] = $obj;
    }   

//echo $parent_id;  
echo json_encode($arr);
?>