$("#grid").kendoGrid({
dataSource: dataSource,
navigatable: true,
pageable: true,
sortable: true,
height: 400,
filterable: false,
toolbar: [
{ name: "create", text: "<?
php
echo $this->translate("Add Account"); ?>" }
],
columns: [
{ field: "Company", width: "120px", title: "<?
php
echo $this->translate("Company"); ?>" },
{ field: "Name", width: "120px", title: "<?
php
echo $this->translate("Name"); ?>" },
{ field: "Email", width: "200px", title: "<?
php
echo $this->translate("Email"); ?>" },
{ field: "AccountID", width: "150px", title: "<?
php
echo $this->translate("Account ID"); ?>" },
{ field: "Active", width: "60px", title: "<?
php
echo $this->translate("Active"); ?>" },
{ field: "Date", width: "110px", title: "<?
php
echo $this->translate("Expired"); ?>", template: '#= kendo.toString(Date,"dd.MM.yyyy") #' },
{ command: [
{name: "edit"},
{name: "destroy"}
]
},
{ field: "PassButton", width: "60px", title: "<?
php
echo $this->translate("Send"); ?>", template: "<
input
type
=
'button'
class
=
'k-button k-button-send'
value
=
''
onclick
=
'myFunction(\"#=AccountID#\")'
/>" }
],
editable: "inline"
});
<
div
id
=
"grid"
></
div
>
<
script
>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "page.php",
type: "post",
dataType: "json"
}
},
schema: {
data: "data",
total: "pageSize"
},
pageSize: 200,
serverPaging: true,
serverSorting: true
},
height: 450,
scrollable: true,
groupable: true,
sortable: true,
filterable: true,
pageable: true,
selectable: "multiple row",
columns: [
{
field: "sel",
template: "<
input
type=\'checkbox\' id=\'select\' name=\'sel\' value=#=ARTICLE_ID# />",
filterable: false,
sortable: false,
groupable: false,
width: 50
},
"CODE",
{
field: "CATEGORY_NAME",
title: "CATEGORY"
}
,
"ARTICLE_NAME",
{
field: "edit",
template: "<
a
class=\'link_page\' href=\'/gestionale/factory/article/edit/id/#=ARTICLE_ID#\'>Edit</
a
>",
filterable: false,
sortable: false,
groupable: false,
width: 50
},
]
});
});
</
script
>
</
head>
<
body>
<form id="form1" runat="server">
<div data-role="layout" data-id="mxl" data-platform="ios">
<div data-role="header">
MobileXus Header
</div>
<div data-role="footer">
iOS MobileXus Footer
</div>
</div>
<div data-role="view" id="flat" data-init="mobileListViewDataBindInitFlat" data-title="ListView" data-layout="mxl">
<ul id="listview">
</ul>
</div>
<script type="text/javascript">
var flatData = ["Sashimi salad", "Chirashi sushi", "Seaweed salad", "Edamame"];
function mobileListViewDataBindInitFlat() {
$(
"#listview").kendoMobileListView({ dataSource: flatData });
}
var deviceJDS = new kendo.data.DataSource({
transport: {
read: {
contentType:
"application/json; charset=utf-8",
type:
"POST",
data:
"{}",
dataType:
"json",
url:
"WebServices/TestService.asmx/GetList"
}
}
});
var app = new kendo.mobile.Application();
</script>
</form>
</
body>
</
html>
///
<summary>
///
Summary description for TestService
///
</summary>
[
WebService(Namespace = "http://tempuri.org/")]
[
WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.
ScriptService]
public
class TestService : System.Web.Services.WebService {
public TestService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[
WebMethod]
[
ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public Array GetList() {
DeviceSvc.
Device dsvc = new DeviceSvc.Device();
DeviceSvc.
Device1[] devices = null;
ArrayList devlist = new ArrayList();
devices = dsvc.SelectAll();
foreach (DeviceSvc.Device1 d in devices)
{
devlist.Add(d.Name);
}
string[] data = { "Rod", "Karen", "Jamie", "Christopher" };
return data;
}
}
ds= new kendo.data.DataSource({ transport: { read: { url: 'method', dataType: "json", type: "POST", contentType: "application/json; charset=utf-8" }, parameterMap: function (options) { return JSON.stringify({ filter: options }); } }, schema: { model: { fields: { Id: { type: "number" }, Name: { type: "string" }, Age: { type: "number" }, BeginDate: { type: "date" }, EndDate: { type: "date" }, Mode: { type: "string" } } } } });
<td># if(EndDate!=null){# #= kendo.toString(toDate(EndDate), "MM/dd/yyyy")# #} else {# ${EndDate}#}#</td>