[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12273] change execute_ajax
From: |
Nelson Guerra |
Subject: |
[Fmsystem-commits] [12273] change execute_ajax |
Date: |
Thu, 06 Nov 2014 23:08:34 +0000 |
Revision: 12273
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12273
Author: nelson224
Date: 2014-11-06 23:08:33 +0000 (Thu, 06 Nov 2014)
Log Message:
-----------
change execute_ajax
Modified Paths:
--------------
branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
Modified: branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
2014-11-05 23:20:34 UTC (rev 12272)
+++ branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
2014-11-06 23:08:33 UTC (rev 12273)
@@ -519,13 +519,17 @@
if(substr_count(action,'delete')>0)
{
action += "&confirm=yes&phpgw_return_as=json";
-
receipt = execute_ajax(action);
+
execute_ajax(action, function(result){
+
document.getElementById("message").innerHTML += '<br/>' +
result;
+
});
oTable.fnDraw();
}
else if
(target == 'ajax')
{
action += "&phpgw_return_as=json";
-
execute_ajax(action);
+
execute_ajax(action, function(result){
+
document.getElementById("message").innerHTML += '<br/>' +
result;
+
});
oTable.fnDraw();
}
@@ -661,6 +665,7 @@
$('select#<xsl:value-of
select="name"/>').change( function() {
oTable.dataTableSettings[0]['ajax']['data']['<xsl:value-of select="name"/>'] =
$(this).val();
oTable.fnDraw();
+ <xsl:value-of select="extra"/>
} );
</xsl:if>
</xsl:for-each>
@@ -680,17 +685,21 @@
return aReturn;
}
- function execute_ajax(requestUrl)
+ function execute_ajax(requestUrl, type, dataType, data,
callback)
{
+ type = typeof type !== 'undefined' ? type :
'POST';
+ dataType = typeof dataType !== 'undefined' ?
dataType : 'html';
+ data = typeof data !== 'undefined' ? data : {};
+
$.ajax({
- type: 'POST',
- dataType: 'json',
+ type: type,
+ dataType: dataType,
+ data: data,
url: requestUrl,
- success: function(data) {
-
document.getElementById("message").innerHTML += '<br/>' + data.receipt;
+ success: function(result) {
+ callback(result);
}
});
-
}
function substr_count( haystack, needle, offset, length
)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12273] change execute_ajax,
Nelson Guerra <=