or
export
var
NAME =
"mike"
;
/// <reference path="kendo.all.d.ts" />
module kendo.data.binders {
export class custom extends Binder {
constructor(element: Element, bindings: { [key: string]: Binding; }, options?: any) {
super
(element, bindings, options);
}
}
/// <reference path="../dts/kendo.all.d.ts" />
import T1 = module(
"test1"
);
module kendo.data.binders {
export class custom extends Binder {
constructor(element: Element, bindings: { [key: string]: Binding; }, options?: any) {
super
(element, bindings, options);
}
}
}
class TreeView extends kendo.ui.Widget {
expand(nodes: string): void;
}
[HttpGet]
public
ActionResult Search([DataSourceRequest] DataSourceRequest request)
{
DataSourceResult result =
new
DataSourceResult();
var data =
new
[] {
new
{ PartID=1, PartNumber=
"ABC123"
, Description=
"Part One"
},
new
{ PartID=2, PartNumber=
"XYZ879"
, Description=
"Part Two"
},
new
{ PartID=3, PartNumber=
"ZZZ999"
, Description=
"Part Three"
},
};
result = data.ToDataSourceResult(request);
return
Json(result, JsonRequestBehavior.AllowGet);
}
var
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
serverPaging:
false
,
serverSorting:
false
,
url:
"@Url.Action("
Search
", "
PartMaster
")"
,
dataType:
"json"
,
type:
"GET"
},
schema: {
data:
"Data"
,
model: {
fields: {
PartID: { type:
"number"
},
PartNumber: { type:
"string"
},
Description: { type:
"string"
}
}
}
}
},
requestEnd:
function
(e) {
var
response = e.response;
var
type = e.type;
console.log(type);
console.log(response.length);
}
});
function
dataSourceError(e) {
console.log(e.status);
}
dataSource.bind(
"error"
, dataSourceError);
$(
"#resultsGrid"
).kendoGrid({
dataSource:dataSource,
height: 600,
scrollable:
true
,
sortable:
true
,
columns: [{ field:
"PartID"
}, { field:
"PartNumber"
}, { field:
"Description"
}],
dataBound:
function
(e) {
console.log(e);
}
});