changed git call from https to git readonly
[atutor.git] / mods / ldap / jscripts / jqgrid / js / grid.postext.js
1 ;(function($){\r
2 /**\r
3  * jqGrid extension\r
4  * Paul Tiseo ptiseo@wasteconsultants.com\r
5  * \r
6  * Dual licensed under the MIT and GPL licenses:\r
7  * http://www.opensource.org/licenses/mit-license.php\r
8  * http://www.gnu.org/licenses/gpl.html\r
9 **/ \r
10 $.fn.extend({\r
11         getPostData : function(){\r
12                 var $t = this[0];\r
13                 if(!$t.grid) { return; }\r
14                 return $t.p.postData;\r
15         },\r
16         setPostData : function( newdata ) {\r
17                 var $t = this[0];\r
18                 if(!$t.grid) { return; }\r
19                 // check if newdata is correct type\r
20                 if ( typeof(newdata) === 'object' ) {\r
21                         $t.p.postData = newdata;\r
22                 }\r
23                 else {\r
24                         alert("Error: cannot add a non-object postData value. postData unchanged.");\r
25                 }\r
26         },\r
27         appendPostData : function( newdata ) { \r
28                 var $t = this[0];\r
29                 if(!$t.grid) { return; }\r
30                 // check if newdata is correct type\r
31                 if ( typeof(newdata) === 'object' ) {\r
32                         $.extend($t.p.postData, newdata);\r
33                 }\r
34                 else {\r
35                         alert("Error: cannot append a non-object postData value. postData unchanged.");\r
36                 }\r
37         },\r
38         setPostDataItem : function( key, val ) {\r
39                 var $t = this[0];\r
40                 if(!$t.grid) { return; }\r
41                 $t.p.postData[key] = val;\r
42         },\r
43         getPostDataItem : function( key ) {\r
44                 var $t = this[0];\r
45                 if(!$t.grid) { return; }\r
46                 return $t.p.postData[key];\r
47         },\r
48         removePostDataItem : function( key ) {\r
49                 var $t = this[0];\r
50                 if(!$t.grid) { return; }\r
51                 delete $t.p.postData[key];\r
52         },\r
53         getUserData : function(){\r
54                 var $t = this[0];\r
55                 if(!$t.grid) { return; }\r
56                 return $t.p.userData;\r
57         },\r
58         getUserDataItem : function( key ) {\r
59                 var $t = this[0];\r
60                 if(!$t.grid) { return; }\r
61                 return $t.p.userData[key];\r
62         }\r
63 });\r
64 })(jQuery);