or
{"d":["20417","20418","20419","20420","20421","20422","20424","20425","20426","20427","20443","20480","20489","20491","20492","20495","20497","20498"]}
[ServiceContract(Namespace = "QS")][AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]public class PSService{ [OperationContract()] [WebGet(BodyStyle = WebMessageBodyStyle.WrappedRequest)] public string[] GetJobs() { try { StringBuilder sb = new StringBuilder(); sb.Append("select ID from ff_job"); string sql = sb.ToString(); DataTable dt = Database.Instance.ExecuteQueryToDataTable(sql); List<string> IJobList = new List<string>(); string sJobID; foreach (DataRow dr in dt.Rows) { sJobID = dr["ID"].ToString(); IJobList.Add(sJobID); } return IJobList.ToArray();
} catch (Exception ex) { Console.WriteLine(ex.Message.ToString()); return null; } }
<div id="grid">
</div>
<script type="text/javascript"> $(document).ready(function () { $("#grid").kendoGrid({ dataSource: { type: "odata", transport: { read: "http://localhost:3444/BootStrap/PSService.svc/getjobs" }, pageSize: 10 }, schema: { model: { fields: { ID: { type: "number" } } } }, height: 360, groupable: true, scrollable: true, sortable: true, pageable: true, columns: [{ field: "ID", width: 90, title: "Job No." }] }); }); </script>$("#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" });