var orderDataGrid = $("#orderDataGrid").datagrid({
width : "auto",
height : "auto",
idField : "memberid", //【主鍵】
url : "${pageContext.request.contextPath}/orderweb/getOrderList", //【獲得資料介面】
columns : [[ //【列名】
{field : "orderid", title : "訂單編號", width:fixWidth(0.13)},
{field : "uphonenumber", title : "下單人手機號碼", width:fixWidth(0.1)},
{field : "prodname", title : "商品名稱", width:fixWidth(0.1)},
{field : "price", title : "商品市場價", width:fixWidth(0.08), formatter:priceFormatter},
{field : "pointsvalue", title : "商品保險幣價值", width:fixWidth(0.1), formatter:pointsValueFormatter},
{field : "protype", title : "商品類型", width:fixWidth(0.06), formatter:protypeFormatter},
{field : "receiver", title : "收件者", width:fixWidth(0.1)},
{field : "orderstatus", title : "訂單狀態", width:fixWidth(0.1), formatter:orderStatusFormatter},
{field : "udphonenumber", title : "收件者手機號碼", width:fixWidth(0.1)},
{field : "ordertime", title : "下單時間", width:fixWidth(0.15), formatter : updateTimeFormatter},
{
field : "operation", title : "操作", width:fixWidth(0.15), formatter : operationFormatter
}
]],
fitColumns : true,
rownumbers : true,
pagination : true,
pageSize : 10,
pageList : [10, 20],
striped : true,
onBeforeLoad : function(param) {
param.pageindex = param.page;
param.pagesize = param.rows;
var orderid = $("input[name=‘orderid‘]").val();
if(orderid != "" && typeof(orderid) != "undefined" && orderid != null) {
param.orderid = orderid;
}
var phonenumber = $("input[name=‘phonenumber‘]").val();
if(phonenumber != "" && typeof(phonenumber) != "undefined" && phonenumber != null) {
param.phonenumber = phonenumber;
}
var prodname = $("input[name=‘prodname‘]").val(); //【獲得所有name = prodname的input標籤】
if(prodname != "" && typeof(prodname) != "undefined" && prodname != null) {
param.prodname = prodname;
}
var orderstatus = $("select[name=‘ordetstatus‘] option:selected").val();
if(orderstatus) {
param.orderstatus = orderstatus;
}
delete param.page;
delete param.rows;
return true;
},
onClickRow: onClickRowFunction,
onLoadError : onLoadErrorFunction
});