Kendo UI Chart Example

Berikut adalah contoh penggunaan bar chart Kendu UI [code language=”javascript”] var palette = ["#FFF19F", "#E8E277", "#DDDA63", "#D2D34F", "#B0BC13"]; var seriesDefaults = { type: ‘column’, overlay: { gradient: "none" }, labels: { visible: true, format: ‘N1’, padding: { bottom: 0 } }, }; var dataSource = new kendo.data.DataSource({ transport: { read: { url: self.options.bindingUrl, dataType: "json",…

Kendo DropDownList using Static DataSource

Contoh kode kendo DropDownList menggunakan DataSource variabel javascript statik. Isi dropdown (#ParentId) berubah sesuai isi #CompanyId. [code language=”javascript”] var dataSource; $(document).ready(function () { var companyId = $(‘#CompanyId’).val(); dataSource = new kendo.data.DataSource({ data: @Html.Raw(Model.AccountOperationsJson), filter: { field: ‘CompanyId’, operator: ‘eq’, value: (companyId / 1) } }); $(‘#ParentId’).kendoDropDownList({ dataTextField: ‘NameUnit’, dataValueField: ‘Id’, dataSource: dataSource, optionLabel: ‘- tidak…

Reloading / Refreshing Kendo Grid After AJAX

[code language=”javascript”] $(‘#GridName’).data(‘kendoGrid’).dataSource.read(); $(‘#GridName’).data(‘kendoGrid’).refresh(); [/code] read will request the server and reload only reload datasource. There will be no changes in the UI. refresh will re-render items in grid from the current datasource. That’s why both are required http://stackoverflow.com/questions/18399805/reloading-refreshing-kendo-grid Alternatif kalau ingin mengubah filter ketika me-reload grid: [code language=”javascript”] dataSource.query({ page: 1, pageSize: 10, filter:…

Kendo Grid Server Side Filtering Foreign Key using Dynamic Linq

Kasus: grid project, ada foreign key ke contractor. Ada masalah ketika mau memfilter grid berdasarkan nama contractor. Kode di view [code language=”javascript”] columns: [ { field: "Id", type: "number", }, { field: "Name", template: "#= CreateUrl(Id, Name) # ", title: "Nama Proyek", }, { field: "ContractorName", title: "Kontraktor", }, { field: "LastWeeklyReport", sortable: false, filterable:…