kendo-ui

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

KendoUI filter TreeView

烂漫一生 提交于 2019-11-30 06:44:17
I am using the treeview of KendoUI and want to give the user the possibility to filter it. There is even a demo that does what I want (http://demos.kendoui.com/web/treeview/api.html) The Problem is that the filter is only applied to the 1st hierarchy of the TreeView, so if the filter-text is present in a child but not the parent, then the child won't be displayed. Example: Item 1 Item 2 Item xzy Item abc If the search text would be "abc", no item would be displayed. Instead I would like to have the following result: Item 2 Item abc Does anyone know how to do this? This is the code I am using:

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:

Angular-Kendo ComboBox placeholder text not working

两盒软妹~` 提交于 2019-11-30 05:15:00
问题 I have a simple angular-kendo ComboBox on a page without an initially selected value. It should show the placeholder text in that case, but instead it's showing ? undefined:undefined ? HTML <select kendo-combo-box ng-model="Project" k-options='projectOptions'></select> JS app.controller('MyCtrl', function($scope) { $scope.projectData = [ {name: 'Bob', value: 1}, {name: 'Tom', value: 2} ]; $scope.projectOptions = { placeholder: "'Select...'", dataTextField: 'name', dataValueField: 'value',

Submit form with Kendo MVC Grid and other elements

安稳与你 提交于 2019-11-30 05:01:45
I am trying to get a form containing a Kendo MVC grid and other elements to submit. The View model contains contains three string fields and an IEnumerable collection. The grid is server bound. I am not adding any elements or deleting any elements from the list using the grid but the grid contains a check box mapped to a boolean column in the list items. Whenever I submit this form the three string elements return in the post method but the list is always null. Here is the data model: public class Parent { public string Field1 { get; set; } public string Field2 { get; set; } public string

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

How to modify KendoUI DropDownList items

大兔子大兔子 提交于 2019-11-30 03:38:15
问题 We used the Kendo UI DropDownList the first time without binding with knockout. Via jquery a usual html input is transformed into a KendoUI DropDownList. But how can i remove/edit/add items to the options? If i modify the html inputs options via jquery it has no influence on the kendoui dropdown - even with a refresh call afterwards. Any ideas how to do this? Thanks 回答1: Yo mate You should use the dataSource of the combobox. e.g. var ds = $('#YourCombo').data().kendoComboBox.dataSource; then

Change selected value of kendo ui dropdownlist

£可爱£侵袭症+ 提交于 2019-11-30 03:06:51
I have a kendo ui dropdownlist in my view: $("#Instrument").kendoDropDownList({ dataTextField: "symbol", dataValueField: "symbol", dataSource: data, index: 0 }); How can I change the selected value of it using jQuery? I tried: $("#Instrument").val(symbol); But it doesn't work as expected. OnaBai You have to use Kendo UI DropDownList select method (documentation in here ). Basically you should: // get a reference to the dropdown list var dropdownlist = $("#Instrument").data("kendoDropDownList"); If you know the index you can use: // selects by index dropdownlist.select(1); If not, use: //

How to get the displayed data of KendoGrid in json format?

白昼怎懂夜的黑 提交于 2019-11-30 02:58:20
I have a kendoGrid and i would like to get the JSON out of it after filtering and sorting how do I achieve this? something like the following, var grid = $("#grid").data("kendoGrid"); alert(grid.dataSource.data.json); // I could dig through grid.dataSource.data and I see a function ( .json doen't exist I put it there so you know what i want to achieve ) Thanks any help is greatly appreciated! Petur Subev I think you're looking for var displayedData = $("#YourGrid").data().kendoGrid.dataSource.view() Then stringify it as follows: var displayedDataAsJSON = JSON.stringify(displayedData); Hope

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