Merge pull request #194 from bale836/master
Support post+json for table module
This commit is contained in:
commit
ea0c76e4fc
@ -411,11 +411,18 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
|
|||||||
var params = {};
|
var params = {};
|
||||||
params[request.pageName] = curr;
|
params[request.pageName] = curr;
|
||||||
params[request.limitName] = options.limit;
|
params[request.limitName] = options.limit;
|
||||||
|
|
||||||
|
var tmpdata = "";
|
||||||
|
if(options.contenttype.indexOf("application/json") == 0){
|
||||||
|
tmpdata = JSON.stringify($.extend(params, options.where));
|
||||||
|
} else {
|
||||||
|
tmpdata = $.extend(params, options.where);
|
||||||
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: options.method || 'get'
|
type: options.method || 'get'
|
||||||
,url: options.url
|
,url: options.url
|
||||||
,data: $.extend(params, options.where)
|
,contentType: options.contenttype
|
||||||
|
,data: tmpdata
|
||||||
,dataType: 'json'
|
,dataType: 'json'
|
||||||
,success: function(res){
|
,success: function(res){
|
||||||
if(res[response.statusName] != response.statusCode){
|
if(res[response.statusName] != response.statusCode){
|
||||||
|
Loading…
Reference in New Issue
Block a user