You can custom the 'poster' function to retrieve any data from the server. Please look at this code.
<script>
$.extend($.fn.edatagrid.defaults, {
poster: function(url, data, success, error){
$.ajax({
type: 'post',
url: url,
data: data,
dataType: 'json',
success: function(data){
if (data.row){
success(data.row);
} else {
success(data);
}
if (data.message){
$.messager.alert('Message', data.message);
}
},
error: function(jqXHR, textStatus, errorThrown){
error({
jqXHR: jqXHR,
textStatus: textStatus,
errorThrown: errorThrown
});
}
});
}
})
</script>
You can return the json data to the browser.
{"row":{...},"message":"..."}
If the 'message' exists, the message alert will display.