kendo-grid

Set default filter for Kendo UI Grid

余生颓废 提交于 2019-11-30 08:27:06
问题 I have a Kendo UI grid that is rendered with javaScript. I want the string columns to have a single option ("Contains") and without the second filter. So far so good, I wrote $("#MyGrid").kendoGrid({ // other bits of configuration here filterable: { extra:false, operators: { string:{ contains: "Contains"} } }, // more bits of configuration here }); As part of the definition of the grid. And the result looks good-ish (I only have one option, so the drop down is redundant). However, regardless

How to change page size dynamically in Kendo UI Grid

北城以北 提交于 2019-11-30 08:15:00
I am having a Kendo UI grid showing more than 1000 data. I also have a dropdown list for different page size - 15, 25, 50, 100. On selection of a page size, how can we change the page size of Kendo UI grid? Daniel You can set the page size in the combobox change event. (Also see JSBin example .) $("#comboBox").kendoComboBox({ dataTextField: "text", dataValueField: "value", dataSource: [ { text: 1 }, { text: 2 }, { text: 3 }, { text: 4 }, { text: 5 } ], change: function(e) { var grid = $("#grid").data("kendoGrid"); grid.dataSource.pageSize(parseInt(this.value())); // this.value() being the

How to change Kendo UI grid page index programmatically?

别来无恙 提交于 2019-11-30 08:08:26
I have a kendo ui grid. Let's say that the JS variable pointing to the grid is called grid . How can I go to page 3 programmatically? Thanks. OnaBai You might to use: grid.dataSource.query({ page: 3, pageSize: 20 }); Documentation in here . or: grid.dataSource.page(3); Documentation in here Answer is just set it pate: 1 when datasource created var dataSource = new kendo.data.DataSource({ data: [ { name: "Tea", category: "Beverages" }, { name: "Coffee", category: "Beverages" }, { name: "Ham", category: "Food" } ], page: 1, // a page of data contains two data items pageSize: 2 }); 来源: https:/

Kendo: Handling Errors in Ajax Data Requests

北慕城南 提交于 2019-11-30 07:19:03
问题 Using Kendo UI in MVC4 I have a Grid that makes Ajax calls for data back into the Controller: public ActionResult SearchUser_Read([DataSourceRequest]DataSourceRequest request) { var data = CreateAnExcaptionHere(); return Json(data.ToDataSourceResult(request)); } How do I use this call to inform the page that there was an error? 回答1: If you need to display an error message from the server then you can do it by returning a DataSourceResult object with only its Errors property set: return this

How Can I Have Row Number In Kendo UI Grid

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 05:57:12
问题 I have kendo grid in asp.net mvc and i use server wrapper.I want Additional column named "Row Number" that is simple counter (1,2,3,...). I want this counter never change by client sorting. Always first row be 1 second row be 2 ,... in column "RowNumber" how can I do this in kendo grid ? 回答1: You can use the dataBound event: $("#grid").kendoGrid({ sortable: true, dataSource: [{ name: "Jane Doe", age: 30 }, { name: "John Doe", age: 33 }], columns: [{ field: "name" }, { field: "age" }, { field:

Kendogrid destroy() and recreate the table on a new datasource, why do the old table columns still exist?

霸气de小男生 提交于 2019-11-30 04:56:56
When invoking destroy() in KendoUI Grid and then recreate the table on a new DataSource : why do the old table columns still exist? The only element here that stays the say is the element. How do I tell the grid to read the new datasource columns (it reads everything else correct). (if I make 2 different elements, they both populate properly but I rather just keep 1 element and replace the elements table by destroy and reinit) Most probably this is because you are not clearing the content inside the Grid container. e.g. $('#gridName').data().kendoGrid.destroy(); $('#gridName').empty(); or

Error The length of the string exceeds the value set on the maxJsonLength property

匆匆过客 提交于 2019-11-30 01:29:19
I am currently have a grid with PDF attachment. Each PDF can have file size up to 1MB. The problem is I am getting the value " Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property " I already placed the following in the web.config but the problem is it works only if the Kendo UI Grid needs to display 6 records. <system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength = "2147483647"></jsonSerialization> </webServices> </scripting> </system.web.extensions> Spidey

Refresh a single Kendo grid row

ぐ巨炮叔叔 提交于 2019-11-29 22:12:07
Is there a way to refresh a single Kendo grid row without refreshing the whole datasource or using jQuery to set the value for each cell? OnaBai How do you define the row that you want to update? I'm going to assume that is the row that you have selected, and the name of the column being updated is symbol . // Get a reference to the grid var grid = $("#my_grid").data("kendoGrid"); // Access the row that is selected var select = grid.select(); // and now the data var data = grid.dataItem(select); // update the column `symbol` and set its value to `HPQ` data.set("symbol", "HPQ"); Remember that

manually maintain dirty cell marker on paging in Kendo grid

て烟熏妆下的殇ゞ 提交于 2019-11-29 19:29:37
问题 I have an editable Kendo grid where I can edit a cell and the grid adds the red mark to the upper left hand corner of the cell. I go to another page and then come back to the page where the edit took place and the red mark is gone but the newly added value in the cell remains. I saw a response to this on the Kendo site where it was advised that: "In order to show the "dirty flag" every time the grid is rebound it will have to iterate through all the model, check all fields if changed and

Kendo UI grid and custom popup delete confirmation

為{幸葍}努か 提交于 2019-11-29 17:59:13
I've got a kendoui grid and I'm using it inside a metronic template... I wish to change the delete confirmation popup (not the text) with a colored better one . I'm using MVC Kendo helpers to create the grid and as far as I've seen there's no piece of code where intercept the popup message (ex. http://www.keenthemes.com/preview/metronic/theme/templates/admin/ui_confirmations.html Event Handling) anyone has success with it? Thanks in advance The delete confirmation popup is a build-in browser alert box <script> alert("Hello! I am an alert box !"); </script> so u need a custom grid command with