Telerik Forums
Kendo UI for jQuery Forum
2 answers
98 views

Hi,

Is it possible to create a scheduler that show 2 or more days like the outlook calendar?

Ravi
Top achievements
Rank 1
 answered on 20 Dec 2017
6 answers
3.1K+ views

I have three components that work together to filter a KendoGrid and filter each other.  Basically when DropDownA gets changed, it should clear any selected values of the MultiSelect, then filter the MultiSelect's dataSource.  It works fine on the very first change event of DropDownA, but after that it clears the values from the MultiSelect (calling .value() on it returns []), but does not update the UI--any previously selected values will still be there.  The Kendo Components do use server filtering.  I've tried clearing the filter before setting the value, as well as setting the value to null, "", and []--all produce the same or similar behavior.

function onChange() {
    stationDropDown.select(-1);
    hydrantGroupMultiSelect.value(null);
 
    stationDropDown.dataSource.filter({}, {
        branchGroupId: value
    });
 
    hydrantGroupMultiSelect.dataSource.filter({}, {
        branchId: "",
        branchGroupId: value
    });
}

Above is the change event of DropDownA, and my multiSelects config:

$('#' + options.thisId).kendoMultiSelect({
    value: "None Selected",
    dataSource: // A Backbone DataSource wrapper we use,
    dataTextField: "id",
    dataValueField: "description",
    filter: "contains",
    placeholder: "None Selected",
    change: _.bind(function (e) {
        // Some Change Event code unrelated to this problem
    }, this)
});

Digging through the Kendo library code to see how the behavior changes between the two (first change event and subsequent change events) is that around line 31258 in kendo.all.js, listView.isFiltered() is set to false on first change event, and set to true on subsequent change events, which causes different behavior.  If I remove the filtering on the multiSelect in the change event, the component behaves properly.

 

Any ideas?

 

Thanks

 

 

 

 

 

iConect Developer - Mike
Top achievements
Rank 1
 answered on 20 Dec 2017
1 answer
4.7K+ views

I am new to Kendo UI and trying to implement required field validation inside Kendo grid. All the functionalities like add/update/delete functionalities are working except required field validation.

 

$(document).ready(function () {
 
 
    var dataSource1 = new kendo.data.DataSource({
        batch: true,
        transport: {
 
           // PUT /POST Codes
 
        },
        error: function(e){
            alert('Error code: ' + e.xhr.status + ' - The application encountered an issue please try again. If issue persist contact grh support team');
        },
        pageSize: 500,
        schema: {
            model: {  id:"Id", fields : { firstname : { editable : true , validation : { required : true }, type : "string" },createdby : { editable: false, defaultValue: "arjun.vadi"},createddate : { editable: false },modifiedby : { editable: false },modifieddate : { editable: false },tz : { editable: false, defaultValue: new Date().toString().substr(28,5) }} }
        },
    });
 
    var grid = $("#grid").kendoGrid({
        height: 620,
        dataSource: dataSource1,
        toolbar: ['create', 'save', 'excel'],
        excel: {
            fileName: "TestMandate" + "_Export.xlsx",
            allPages: true
        },
        pageable: {
            numeric: false,
            previousNext: false,
            messages: {
                display: "Total: {2}"
            }
        },
        navigatable: true,
        sortable: true,
        filterable: true,
        resizable: true,
        scrollable: true,
        editable: true,
        columns: [
            { command: [{ name: "destroy", text: "", width: "60px" }], title: " ", width: "100px" },
            { field: "firstname",title:"FirstName",editor: JSHelper.stringEditor, width: 100 , filterable: { multi: true, search: true } },{ field: "createdby",title: "Created By", width: 100, filterable: { multi: true, search: true } },{ field: "createddate",title: "Created Date", width: 100, editor : JSHelper.dateAdminEditor, template: "#= kendo.toString(kendo.parseDate(createddate), 'dd MMM yyyy hh:mm') #", filterable: { multi: true, search: true } },{ field: "modifiedby", title: "Modified By", width: 100, filterable: { multi: true, search: true, search: true } },{ field: "modifieddate", title: "Modified Date", width: 100, editor : JSHelper.dateAdminEditor,  template: "#= kendo.toString(kendo.parseDate(modifieddate), 'dd MMM yyyy hh:mm') #", width:150, filterable: { multi: true, search: true } },
        ],
 
    });
});

 

 

Viktor Tachev
Telerik team
 answered on 20 Dec 2017
1 answer
123 views

Reading through documentation (https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Editing/preserve-the-dirty-indicator-in-incell-editing-and-client-operations) it looks like the Kendo UI R3 2017 update made the dirty indicator built in functionality for editable grids. I have a grid in my product that didn't expect the dirty flag to appear. It looks like the only solution is to add CSS to prevent the flags from appearing (https://docs.telerik.com/kendo-ui/knowledge-base/disable-dirty-indicator-using-css). Is that correct? Is there any other way to deactivate the dirty flags?

As for the potential issue that I noticed, when the flag appears in my product, it appears right on the top left of the content that was edited. This works well if all the cells are one line long, but if other some cells in a row span multiple lines, the dirty flag appears to just be floating in the middle of the cells that are only one line long. Using this example (https://dojo.telerik.com/osuRi) You can change a product name to span many lines, then change teh corresponding unit price and you will see the dirty flag on the unit price appears to be floating rather than at the top of the cell. It feels a little odd that the indicators may be out of place. Is this expected behavior? 

Preslav
Telerik team
 answered on 20 Dec 2017
1 answer
159 views

kendo.all.d.ts v2017.3.1026.

kendo.data.DataSourceOptions does not contain inPlaceSort configuration option.

Konstantin Dikov
Telerik team
 answered on 20 Dec 2017
2 answers
100 views

Hi, 

As my title says, how can i enable a specific date that is outside the min and max range?

How can i enable the 5th as well in this example? https://dojo.telerik.com/uKuMap

Can this be done by using the 'dates' config attribute?

Thanks,
Grant

Grant
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 20 Dec 2017
6 answers
944 views
Hi, I'm trying to bind a Kendo treeview to a model of Users & Groups. A group contains a list of users and CAN contain a list of groups (and each group in turn can contain more users and more groups). I'd also like to be able to assign a node an icon depending on whether it's a user node or a group node. 

The models:

public class Group
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public int? ParentID { get; set; }
        public List<Group> Groups { get; set; }
        public List<User> Users { get; set; }
    }

    public class User
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public int GroupID { get; set; }
    }

And here's  a method to get the data I want to bind to the treeview:
private IEnumerable<Group> GetUserGroups()
        {
            List<Group> model = new List<Group>
                {
                    new Group()
                    {
                        ID = 1,
                        Name = "Admin",
                        ParentID = 1,
                        Users = new List<User>()
                        {
                            new User()
                            {
                                ID = 1,
                                Name = "John Doe",
                                GroupID = 1
                            },
                            new User()
                            {
                                ID = 2,
                                Name = "Jane Smith",
                                GroupID = 1
                            },
                        },
                        Groups = new List<Group>
                        {
                            new Group()
                            {
                                ID = 2,
                                Name = "Support",
                                ParentID = 1,
                                Users = new List<User>()
                                {
                                    new User()
                                    {
                                        ID = 1,
                                        Name = "Johnny Support",
                                        GroupID = 2
                                    }
                                }
                            },
                            new Group()
                            {
                                ID = 3,
                                Name = "Production",
                                ParentID = 1,
                                Users = new List<User>()
                                {
                                    new User()
                                    {
                                        ID = 1,
                                        Name = "Johnny Production",
                                        GroupID = 3
                                    }
                                }
                            }
                        }
                    }
                };
 
            return model;
        }

When I try to do the below: 

@(
        Html.Kendo().TreeView()
            .Name("treeview")
            .BindTo((IEnumerable<TreeViewItemModel>)ViewBag.inlineDefault)
    )

I get a casting error  ... Unable to cast object of type 'System.Collections.Generic.List`1[MyApp.Models.Admin.Group]' to type 'System.Collections.Generic.IEnumerable`1[Kendo.Mvc.UI.TreeViewItemModel]'.

Any help would be appreciated, thanks.

Victor
Top achievements
Rank 1
 answered on 20 Dec 2017
0 answers
226 views

We have the following case: 

We have editable kendoo grid and editable kendoo form. I would like to make Front End automation testing with selenium webdriver for our application. 

During testing I would like to be able to add/delete/update entries via grid and via form. Please provide a recommendations / best practices to do that.

You can find an example of our application under test here: https://www.telerik.com/forums/edit-records-using-external-forms-with-editable-grid

 

 

evyatar
Top achievements
Rank 1
 asked on 19 Dec 2017
1 answer
225 views

I have a 'Select All' option in the columnMenu as demonstrated in the following example:

https://docs.telerik.com/kendo-ui/knowledge-base/grid-include-selectall-in-columnmenu

 

This was working as expected in version 2017.3.913.  After upgrading I now encounter an issue whenever I open the menu, close it and then re-open.  The following example demonstrates the problem:

https://dojo.telerik.com/IcOYO

Opening the 'Order ID' columnMenu and selecting 'Columns' shows a 'SelectAll' option on the top as expected.  When opening for a second time, 'SelectAll' is moved to the bottom.  In addition, selecting 'Filter' shows that a 'Column ID' option has been added above the filter options.  I have been unable to determine whether this is a known issue in the current version (2017.3.1026).

Stefan
Telerik team
 answered on 19 Dec 2017
6 answers
458 views

Hi, 

For some reason the min and max dates are only enforced on the calendar popup, not in the scheduler navigation. 
The scheduler is first initialized without the min and max attributes, then I set them using setOptions() method. The reason being the restrictions are based on other parameters.
If I print the scheduler reference in the console, the min and max attributes are populated as expected. However as I said before, the restriction only applies to the calendar popup.

For example, if the max date is 2017-12-31 and the view is "month". If i click the 'next' navigation button, something is happening. I say it like that because the datsource is refreshing, but the displayed month is not changing to January.

I'm trying to explain my problem as best I can but honestly, haven't got a clue what going on. I hope you are able to help, I'll continue to investigate myself and hopefully will have more info for you when you reply.

Thank and kind regards, 
Grant

Veselin Tsvetanov
Telerik team
 answered on 19 Dec 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?