or
01.
var
expenseFormDataSource =
new
kendo.data.DataSource({
02.
transport: {
03.
read: {
04.
url: EA.baseURL +
"resources/expenseService/getExpenseForms"
,
05.
dataType:
"xml"
,
06.
type:
"POST"
07.
},
08.
parameterMap:
function
(options) {
09.
return
{
10.
token: EA.getToken()
11.
};
12.
}
13.
},
14.
schema: {
15.
type:
"xml"
,
16.
data:
"expenseForms/expenseForm"
,
17.
model: {
18.
fields: {
19.
id:
"id/text()"
,
20.
date:
"date/text()"
,
21.
statusId:
"statusId/text()"
22.
}
23.
}
24.
}
25.
});
1.
$(
"#expenseFormList"
).kendoMobileListView({
2.
dataSource: expenseFormDataSource,
3.
pullToRefresh:
true
,
4.
template: $(
"#expenseForm-template"
).text()
5.
});
1.
<
script
id
=
"expenseForm-template"
type
=
"text/x-kendo-template"
>
2.
<
a
data-role
=
"listview-link"
id=#="\"my-expenses-show-pdf-" + id+ "\""#>
3.
<
div
class
=
"expenseForm-date"
>#= kendo.toString(new Date(Date.parse(date)), "dd/MM/yyyy") #</
div
>
4.
<
div
class
=
"expenseForm-status"
>Status: #= expenseStatusIdToString(statusId) #</
div
>
5.
</
a
>
6.
</
script
>
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Length: 7
Content-Type: application/json
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?QzpcQ29kZVxGTVNcTWFpblxQcm9qZWN0QWNjb3VudGluZ1xEYXRhU2VydmljZXNcRG9jdW1lbnRzLmFzbXhcRG9jdW1lbnRfQ1JFQVRF?=
X-Powered-By: ASP.NET
Date: Tue, 09 Apr 2013 23:14:56 GMT
" { } "
{"odata.metadata":"http://localhost:49639/api/$metadata#Address/@Element","AddressKey":"1","AddressLine1":"test2","AddressLine2":"Suite 2004","City":"Lawrenceville","State":"Georgia","PostalCode":"30043"}
parse: function(response) {
// This property causes an issue when sending the model back, so removing it.
delete response["odata.metadata"];
},
01.
<
div
class
=
"k-rtl"
>
02.
@(Html.Kendo().Grid<
BO.UserPemissions
>()
03.
.Name("UserPemissionsGrid").Events(e => e.DataBound("UserPemissionsRowDataBound"))
04.
.Columns(columns =>
05.
{
06.
columns.Bound(o => o.UserId).Title("ת.ז.");
07.
columns.Bound(o => o.PermittedProgramGroup).Title("קבוצות הרשאה");
08.
columns.Bound(o => o.PermittedProgramId).Title("תוכניות מורשות");
09.
columns.Command(command => command.Destroy()).Width(150);
10.
})
11.
.Pageable(pager => pager.PageSizes(true))
12.
.ToolBar(toolBar => { toolBar.Create(); toolBar.Save(); })
13.
.Sortable()
14.
.Scrollable()
15.
.Editable(editable => editable.Mode(GridEditMode.InCell))
16.
.DataSource(dataSource => dataSource.Ajax().Model(model => model.Id("UserId")).Read(read => read.Action("UserPemissionsRowDataRead", "Home"))
17.
.Update(update => update.Action("UserPemissionsRowDataUpdate", "Home"))
18.
.Create(update => update.Action("UserPemissionsRowDataCreate", "Home"))
19.
.Destroy(update => update.Action("UserPemissionsRowDataDestroy", "Home"))
20.
)
21.
)
22.
</
div
>