I use Bootstrap + Kendo UI as explained here http://docs.telerik.com/kendo-ui/third-party/using-kendo-with-twitter-bootstrap.
However, when I include the Bootstrap css, it shifts the items in k-window-titlebar slightly lower which doesn't look very good.
You can seen the effect in this Kendo UI Dojo: http://dojo.telerik.com/apeWu
Could you please provide a workaround or fix?
var FilterMenu = Widget.extend(... filter: function(expression) { expression = this._merge(expression); if (expression.filters.length) { this.dataSource.filter(expression); } else { // Add these lines this.dataSource.read(); // Add these lines } // Add these lines },Hello,
I have this code that can do a partial search on the first name or last name of any rows.
http://jsfiddle.net/EaNm4/520/
$(document).ready(function() { var data = [ {firstName: 'Bob test', lastName: 'Kelso'}, {firstName: 'abc test', lastName: 'def'}, {firstName: 'toto test', lastName: 'tata'}, {firstName: 'foo test', lastName: 'var'}, ]; $("#grid").kendoGrid({ dataSource: {data: data}, height: 350, columns: ['firstName', 'lastName'] }); var searchOperator = function(items, filterValue) { items = items.toLowerCase(); var searchText = $('#search').val().toLowerCase().split(/[\s,]+/); if (searchText.length) { var found = true; for(var s in searchText) { if (items.indexOf(searchText[s]) == -1) { found = false; break; } } return found; } return true; }; $('#search').on('change', function() { var dataSource = $("#grid").data('kendoGrid').dataSource; var searchText = $(this).val(); dataSource.filter({ logic:"or", filters: [{ field: 'firstName', operator: searchOperator },{ field: 'lastName', operator: searchOperator }] }); }); });
If you type "bob", "bob test", "bo te", or "kel" in the search box, the first rows will stay visible.
As long as you have a partial word, you will get the rows.
But if you search for a word in both cols, like "bob kelso" the row will not be display.
Is there a way to be able to search multiple fields at the same time, so "bob kelso" will display the first rows?
I was thinking maybe of a way that when the datasource is loaded, it will create a new field with all the data of all other rows, so when I do a search like that, I would simply search that field... is there a way to do something like that... or maybe you have a better suggestion?
Thank you
Hello,
In the exemple: "http://dojo.telerik.com/AReza", how can i set minimum value for menu popup "Show items with value that". column "Units in Stock" i not want the value less than 0.
Hello,
We have a grid that maps nested model properties. We have used the schema 'from' option exactly as outlined here: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/use-nested-model-properties
However this does not work properly if the grid is configured with incell editing. Instead of editing the variable at its original location (as specified by the 'from' option), the grid just creates new dummy variables on the target object with the same name as the schema field. Any edits are then stored into those dummy fields rather than to the original location.
Here is a dojo example that reproduces the issue: http://dojo.telerik.com/eLOpI
If you open the console there is a timer that logs the toJSON() content of the object in the grid. You can see the dummy variables that get created, and whenever you make edits to the object the dummy variables update, but the original nested ones don't.
regards,
Rowan
I am using inline editing and creating a new record. The record is created by the controller and sent back to the webpage, but the kendo grid is not accepting it. Therefore it does not have the Id, and further edits (before refreshing the page) cause the grid to create another record. It is the same problem from this thread, however following their solution did not fix my issue.
Here is my grid/view
@(Html.Kendo().Grid(@Model.contactList) .Name("AgentContactsGrid") .Columns(columns => { columns.Bound(d => d.TypeId).EditorTemplateName("ContactType").Title("Type").ClientTemplate("#:TypeAsString#").Width("120px"); columns.Bound(m => m.Information) .Title("Information"); columns.Command(command => { command.Edit(); command.Destroy(); }).Width("200px"); }) .ToolBar(commands => commands.Create().Text("New Contact")) .Editable(editable => { editable.Mode(GridEditMode.InLine); editable.DisplayDeleteConfirmation("Delete this Contact?"); }) .Pageable(x => x.Enabled(true)) .Events(e => { e.Save("ContactUpdate"); }) .DataSource(ds => ds .Ajax() .Create(create => create.Action("CreateContact", "Users")).Read("ReadContact", "Users") .Read(read => read.Action("ReadContact", "Users")) .Update(update => update.Action("UpdateContact", "Users")) .Destroy(destroy => destroy.Action("DeleteContact", "Users")) .Model(model => model.Id(m => m.Id)) .PageSize(5) .Total(Model.contactList.Count) .Events(events => events.RequestEnd("onRequestEnd")) ))
Here is a function I use to set some values, in case it matters (if i can get this to work I won't need it any more)
function ContactUpdate(e) { e.model.set("UserId", @Model.userDto.Id); $.ajax( { url: "/Users/GetContactTypeById", dataType: "JSON", data: { id: e.model.TypeId }, success: function (data) { e.model.set("TypeAsString", data.result); }, error: function() { e.model.set("TypeAsString", "error"); } }); }
Here is my controller method for creating
public ActionResult CreateContact([DataSourceRequest] DataSourceRequest request, UserContactDto contact) { //insert the record to the DB if (contact != null && ModelState.IsValid) { contact.Id = _userServices.AddUserContact(contact, CurrentUser.UserId); } //return the updated record which contains the correct model ID return Json(new[] { contact }.ToDataSourceResult(request, ModelState)); }
And finally here is an example of what is returned to the page (from network in inspect)
{ "success": true, "result": { "data": [ { "userId": 609001, "typeId": 405, "information": "123-123-1234", "typeAsString": null, "id": 182 } ], "total": 1, "aggregateResults": null, "errors": null }, "error": null, "unAuthorizedRequest": false}
Any help would be appreciated.
Is it possible to change the color of a specified cell programmatically, after Spreadsheet initialisation? Apologies if there's documentation to this effect, I haven't managed to find it.
E.g. $("#spreadsheet").data("kendoSpreadhseet").activeSheet().range("J2").setState({background: "#000000"})