| |
54 |
54 |
ad_proc -public ah::ext::ajax { |
| |
55 |
55 |
-url |
| |
56 |
56 |
{-params {}} |
| |
57 |
57 |
{-success ""} |
| |
58 |
58 |
{-failure ""} |
| |
59 |
59 |
} { |
| |
60 |
60 |
|
| |
61 |
61 |
Wrapper for Ext.Ajax.request |
| |
62 |
62 |
http://extjs.com/deploy/ext/docs/output/Ext.Ajax.html#request |
| |
63 |
63 |
|
| |
64 |
64 |
@author Hamilton Chua (ham@solutiongrove.com) |
| |
65 |
65 |
@creation-date 2007-09-07 |
| |
66 |
66 |
|
| |
67 |
67 |
@param url The url that the javascript will post to |
| |
68 |
68 |
@param params A tcl list of parameters to pass to the url |
| |
69 |
69 |
@param success A javascript function to be executed when the url is successfully accessed |
| |
70 |
70 |
@param failure A javascript function to execute if transaction failed. |
| |
71 |
71 |
|
| |
72 |
72 |
} { |
| |
73 |
73 |
set script "Ext.Ajax.request({url:\"$url\"" |
| |
74 |
|
if { [exists_and_not_null params] } { append script ",params:$params" } |
| |
75 |
|
if { [exists_and_not_null success] } { append script ",success:$success" } |
| |
76 |
|
if { [exists_and_not_null failure] } { append script ",failure:$failure" } |
| |
|
74 |
if { ([info exists params] && $params ne "") } { append script ",params:$params" } |
| |
|
75 |
if { ([info exists success] && $success ne "") } { append script ",success:$success" } |
| |
|
76 |
if { ([info exists failure] && $failure ne "") } { append script ",failure:$failure" } |
| |
77 |
77 |
append script "}); " |
| |
78 |
78 |
return $script |
| |
79 |
79 |
} |
| |
80 |
80 |
|
| |
81 |
81 |
ad_proc -public ah::ext::msgbox { |
| |
82 |
82 |
{-options {}} |
| |
83 |
83 |
} { |
| |
84 |
84 |
|
| |
85 |
85 |
Wrapper for Ext.MessageBox. |
| |
86 |
86 |
http://extjs.com/deploy/ext/docs/output/Ext.MessageBox.html |
| |
87 |
87 |
Possible options are listed in |
| |
88 |
88 |
http://extjs.com/deploy/ext/docs/output/Ext.MessageBox.html#show |
| |
89 |
89 |
|
| |
90 |
90 |
<b>options</b> is a list of lists e.g. |
| |
91 |
91 |
set options [list [list "title" "\"Sample Progress Bar\""] [list "progress" "true"] [list "progressText" "\"Please wait ...\""] ] |
| |
92 |
92 |
|
| |
93 |
93 |
it is fed to ah::ext::msgbox like this |
| |
94 |
94 |
set popup_script [ah::ext::msgbox -options $options] |
| |
95 |
95 |
|
| |
96 |
96 |
|