or
$(document).ready(
function
() {
$(
"#GetBOData"
).click(
function
(){
$.ajax({
type :
'POST'
,
url :
"/~basadmin/corp/reports/get_store_bkord_data.php"
,
data : {
BeginDate : $(
"#BeginDate"
).val(),
EndDate : $(
"#EndDate"
).val()
},
success :
function
(data, textStatus, jqXHR) {
//alert(data);
$(
"#grid"
).kendoGrid({
dataSource: {
dataType:
"json"
,
data: data,
//transport: {
// read: {
// url:"/~basadmin/corp/reports/get_store_bkord_data.php",
// dataType: "json"
// }
//},
//schema: {
// model: {
// fields: {
// Buyer: { type: "string" },
// Line: { type: "string" },
// Category: { type: "number" },
// PartNum: { type: "string" },
// Description: { type: "string" },
// StoreLoc: { type: "number" },
// WhseLoc: { type: "WhseLoc" }
// }
// },
//total: "total"
//},
serverPaging:
false
,
serverSorting:
false
,
pageSize: 1000
},
columns: [
{title:
"Buyer"
, field:
"Buyer"
, width: 75},
{title:
"Line"
, field:
"Line"
, width: 75},
{title:
"Category"
, field:
"Category"
, width: 100},
{title:
"Part Number"
, field:
"PartNum"
, width: 110},
{title:
"Description"
, field:
"Description"
, width: 100},
{title:
"Store Loc"
, field:
"StoreLoc"
, width: 100},
{title:
"Whse Loc"
, field:
"WhseLoc"
, width: 100}
],
scrollable:
true
,
height: 800,
filterable:
true
,
sortable: {
mode:
"multiple"
,
allowUnsort:
true
},
groupable:
true
,
pageable:
true
,
navigatable:
true
,
});
}
});
});
});
<
body
>
Begin Date: <
input
type
=
"text"
name
=
"BeginDate"
id
=
"BeginDate"
/>
End Date: <
input
type
=
"text"
name
=
"EndDate"
id
=
"EndDate"
/>
<
input
type
=
"submit"
id
=
"GetBOData"
value
=
"Submit"
/>
<
div
id
=
"grid"
style
=
"width:1280px"
>
</
div
>
</
body
>
[{
"Buyer"
:
"Joe Smo"
,
"Line"
:
"GBR"
,
"Category"
:
"1"
,
"PartNum"
:
"833-22101"
,
"Description"
:
"Fuel Injector"
,
"StoreLoc"
:
"34"
,
"WhseLoc"
:
"90"
}]
var
ds =
new
kendo.data.DataSource({
transport: {
read: {
url:
"/admin/users"
,
dataType:
"json"
}
}
});
$(
"#user-grid"
).kendoGrid({
dataSource: {
data: ds,
pageSize: 10
},
height: 360,
columns: [ {
field:
"firstname"
,
width: 90,
title:
"First Name"
} , {
field:
"lastname"
,
width: 90,
title:
"Last Name"
} , {
field:
"email"
,
title:
"Email"
,
width: 200
}
]
});