]>
git.proxmox.com Git - extjs.git/blob - extjs/build/examples/kitchensink/data/direct/classes/TestAction.php
4 function doEcho($data){
8 function multiply($num){
10 throw new Exception('Call to multiply with a value that is not a number');
15 function getTree($id){
18 for($i = 1; $i <= 5; ++
$i){
19 array_push($out, array(
25 }else if(strlen($id) == 2){
26 $num = substr($id, 1);
27 for($i = 1; $i <= 5; ++
$i){
28 array_push($out, array(
30 'text'=>'Node ' . $num . '.' . $i,
38 function getGrid($params, $metadata){
39 $sort = $params->sort
[0];
40 $field = $sort->property
;
41 $direction = $sort->direction
;
43 $table = $metadata->table
;
45 if ($table == 'customers') {
48 'name'=>'ABC Accounting',
51 'name'=>'Ezy Video Rental',
54 'name'=>'Greens Fruit Grocery',
57 'name'=>'Icecream Express',
63 'name'=>'Smith Auto Mechanic',
68 elseif ($table == 'leads') {
71 'name' => 'AT&T Inc.',
74 'name' => 'General Electric',
77 'name' => 'Intel Corporation',
78 'revenue' => 150000000
80 'name' => 'Verizon Communications',
86 throw new Exception("Wrong table: $table");
89 function sort_fn($property) {
90 $fn_text = "return strnatcmp(\$a['$property'], \$b['$property']);";
92 return create_function('$a, $b', $fn_text);
95 usort($data, sort_fn($field));
97 if ($direction == 'DESC') {
98 $data = array_reverse($data);
104 function showDetails($data){
105 $first = $data->firstName
;
106 $last = $data->lastName
;
108 return "Hi $first $last, you are $age years old.";