kendo-datasource

Is it possible to copy a grid datasource to a new datasource, a new datasource that loads all data?

筅森魡賤 提交于 2020-02-02 12:29:06
问题 Is it possible to copy a grid datasource to a new datasource, a new datasource that loads all data? For example I have a kendo grid which has a page size of 10, how would I copy it into a new datasource which will load all the data and ignore the paging. 回答1: Some aspects might depend on how did you define the DataSource of the first (pageable) datasource. But basically you need to copy the original data source, then change the value for pageSize and serverPaging and finally assign it to the

Kendo UI Remote DataSource Modification

好久不见. 提交于 2020-01-16 01:53:06
问题 I have a Kendo DataSource that takes its data from a remote server (Json) and it bind the data to a kendo template in the client-side. On the client, right now I just display the Data. However, I want to add/remove data in the dataSource as well. How can I send the dataSource after modification back to server and store it in there ? Here is a good example of what I am trying to do. While this example reads its data from a local variable, would you please let me know: How can I store the

Custom filtering with multi-select drop downs

假如想象 提交于 2020-01-07 04:41:10
问题 I have a grid containing three multiselect controls in the toolbar which are to be used to filter the grid datasource based on selections made. At the moment, I have the below function, fired during a change event in any of the multiselect controls. This function accepts values containing the selected items in the multiselect control changed and filterID which is the field name to be used during the filtering. function applyClientFilters(values, filterID) { var grid = $("#grid").data(

how to get query string of kendo datasource

好久不见. 提交于 2020-01-07 04:38:16
问题 I am using kendo grid to which data is provided by kendo data source. I am using quite a complicated filter and thats why I have to use parameterMap function to do some sorting and filtering. When the query is sent, the query string is automatically prepared by the data source and everything works fine. I need a way to store this url (at least the query string) for every read request. Is there a way to access it? 回答1: After some research... that was pretty easy. It is enough to use

How to use URLs like '/update/:id' as KendoUI datasource?

不想你离开。 提交于 2019-12-23 18:04:25
问题 I read the documentation but found nothing related to setting parameters in dataSource urls. Is it possible to achieve that? Thx in advance. 回答1: Yes, it is possible. The url s defined in the DataSource.transport might be a function. This function receives (for update ) as first argument the data being updated (the model) and returns the string that should be used as URL. Composing the URL for what you want to do is: var ds = new kendo.data.DataSource({ transport: { read: { url: function () {

Interceptor for Authorization headers using Kendo UI datasource

a 夏天 提交于 2019-12-13 13:27:12
问题 I am using webapi and restrict web api's to authenticate by token, so to populate datasource I use request headers in DataSource. var abcDatasource = new kendo.data.DataSource({ transport: { read: { url: '/api/exampledata', dataType: 'json', headers: { 'Authorization': 'Bearer ' + accesstoken } }, }, pageSize: 5, }); the below line of code need to repeat at all datasource headers: { 'Authorization': 'Bearer ' + accesstoken } Is it possible to make central function which overwrite the kendo

Format Kendo grid column filter for percentages

浪子不回头ぞ 提交于 2019-12-13 04:59:42
问题 I have a kendo grid and my datasource data returns number with unknown decimal places. So I'm using a parse function on the datasource to compensate for that. DefaultMonoCPP: { editable: false, type: "number", parse: function(e) { return kendo.parseFloat(kendo.toString(e,"p4")); } } Now when I filter, I don't want it to automatically multiply the percentage by 100. So I have filterable set on the columns. { field: "DefaultMonoCPP", title: "Mono Cost", format: '{0:p4}', filterable: { ui:

Uncaught object error Kendo grid read issue

谁都会走 提交于 2019-12-13 04:43:34
问题 I'm new with Kendo. I was trying to create a Kendo grid with data from a remote link My Code: var dataSource = new kendo.data.DataSource({ transport: { read: { url: "http://www.mocky.io/v2/53e1cd17aaabaeaa0bc9a8f9", dataType: "jsonp", //contentType: "application/json; charset=utf-8", } } }); $("#grid").kendoGrid({ dataSource: dataSource, pageable: true, height: 550, editable: "inline" }); Where the remote link return [{"metaId":1,"7":"A","3":"B","10":"C","18":"D","9":"E","5":"F","2":"G","27":

Assigning selected rows as other grid datasource

喜欢而已 提交于 2019-12-12 05:58:44
问题 I am working on setting up a scenario as following: 1) User is shown existing results on first grid 2) User can select multiple results and click an 'Edit' button which will extract the selected items from the first grid 3)Second grid will be populated with the rows the user has selected from the first grid and will allow them to make edits to the content 4)Pressing save will update the results and show the first grid with the rows updated So far using drips and drabs of various forum threads

Kendo UI Treeview - Binding with Hierarchical data

落爺英雄遲暮 提交于 2019-12-12 04:19:34
问题 Sorry for asking basic question, I am using Kendo UI first time. My question is: I have hierarchical data returned from SQL Server Common Type Expression (CTE) in below format Id ParentId Name 1 0 Name-1 (Level 0) 2 0 Name-2 (Level 0) 3 1 Name-3 (Level 1) 4 3 Name-4 (Level 2) and so on... I need to bind this data to Kendo UI Tree View control. All the samples I saw in Kendo UI docs deals with hard coded data and then there is HierachicalDataSoruce examples but in those examples hierarchical