I am just getting started with Kendo and am very intrigued by what has been put together thus far.
At the moment, I am trying to better understand the use of the Grid widget and binding to an external source, but I keep running into conflicting answers in this forum.
What I want to do is to bind to a standard web service (not JSON).
Perhaps I am not understanding this completely, but it seems that in some discussions, people say this is not possible (http://www.kendoui.com/forums/framework/data-source/bind-to-remote-xml.aspx), but then I see other postings saying that it is (http://www.kendoui.com/forums/ui/grid/grid-data-binding-to-xml.aspx).
Either way, I cannot seem to get it to work, in fact, it doesn't even seem to hit my web service at all. Can someone shed some light on this?
Here is my code:
<
script
>
var dateRegExp = /^\/Date\((.*?)\)\/$/;
function toDate(value) {
var date = dateRegExp.exec(value);
return new Date(parseInt(date[1]));
}
var esData = new kendo.data.DataSource({
transport: {
read: { url: "http://localhost/esplanning/esweb.asmx/EmployeeList", type: "xml" }
}
});
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: esData,
schema: {
type: "xml",
data: "/EmployeeListResponse/Results/RowSet/Rows"
},
height: 250,
filterable: true,
sortable: true,
pageable: true });
});
</
script
>
And my corresponding XML data:
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
soap:Envelope
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd
=
"http://www.w3.org/2001/XMLSchema"
xmlns:soap
=
"http://schemas.xmlsoap.org/soap/envelope/"
soap:encodingStyle
=
"http://www.w3.org/2001/12/soap-encoding"
>
<
soap:Body
>
<
EmployeeListResponse
xmlns
=
"http://tempuri.org/"
>
<
Results
xmlns
=
""
CubeName
=
"Employee"
ViewName
=
"EmployeeList"
>
<
Scenario
DimName
=
"Scenario"
ID
=
"Working Budget"
Name
=
"Working Budget"
/>
<
EntityDept
DimName
=
"Entity-Dept"
ID
=
"1110-3030"
Name
=
"1110-3030"
/>
<
ProductLine_s
DimName
=
"Product Line_s"
ID
=
"1020"
Name
=
"Aviation Electronic Solutions"
/>
<
RowSet
ColDims
=
"Employee_m"
>
<
Rows
IsUpdated
=
"false"
>
<
Employee
Name
=
"All Employees - All Employees"
DimName
=
"Employee"
ID
=
"All Employees"
IsUpdated
=
"false"
EmployeeName
=
"All Employees"
>All Employees - All Employees</
Employee
>
<
Position
Name
=
"Current"
DimName
=
"Position"
ID
=
"1"
IsUpdated
=
"false"
>Current</
Position
>
</
Rows
>
<
Rows
IsUpdated
=
"false"
>
<
Employee
Name
=
"Rai, Colleen - 0000000702"
DimName
=
"Employee"
ID
=
"0000000702"
IsUpdated
=
"false"
EmployeeName
=
"Rai, Colleen"
>Rai, Colleen - 0000000702</
Employee
>
<
Position
Name
=
"Current"
DimName
=
"Position"
ID
=
"1"
IsUpdated
=
"false"
>Current</
Position
>
</
Rows
>
<
Rows
IsUpdated
=
"false"
>
<
Employee
Name
=
"Romero, Walter - 0000000806"
DimName
=
"Employee"
ID
=
"0000000806"
IsUpdated
=
"false"
EmployeeName
=
"Romero, Walter"
>Romero, Walter - 0000000806</
Employee
>
<
Position
Name
=
"Current"
DimName
=
"Position"
ID
=
"1"
IsUpdated
=
"false"
>Current</
Position
>
</
Rows
>
</
RowSet
>
</
Results
>
</
EmployeeListResponse
>
</
soap:Body
>
</
soap:Envelope
>