Telerik Forums
Kendo UI for jQuery Forum
5 answers
1.0K+ views

Hi,

I have been switching some our grids to popup editing when adding a new grid while keeping to in-line grid editing for existing records. In the following example there are two dropdown lists. The trial site dropdown is filtered based on the country dropdown selection. This currently works fine in the in-line grid editing version: the two drop down editors populate their respective dropdowns initially. When the trial site dropdown is  selected it repopulates itself (I assume this is default behavior).

The popup editing behaves differently - there doesn't seem to be any default repopulation on the dropdown on selection.

My work round is to put an change event on the Country drop down editor definition but I am unsure how to refresh the dropdown sites editor from my OnChangeCountry function. Can you help?

regards,

Chris

 

function localcountryFilteredSiteLabelDropDownEditor(container, options) {
 
    //Used to filter the site  based on country selected in column
    var trail_countries = [];
 
    //trail_countries.push({ trial_site_id: '0', trial_site_label: 'None' });
    for (var idx = 0; idx < localCountryFromTrialId.length; idx++) {
        if (localCountryFromTrialId[idx].trial_country_id === options.model.trial_country_id) {
            trail_countries.push({ trial_site_id: localCountryFromTrialId[idx]["trial_site_id"], trial_site_label: localCountryFromTrialId[idx].trial_site_label });
        }
    }
 
 
    $('<input name="trial_site_id"  data-text-field="trial_site_label" data-value-field="trial_site_id" data-bind="value:' + options.field + '"/>')
        .appendTo(container)
        .kendoDropDownList({
            name: "trial_site_id",
            autoBind: true,
            dataSource: trail_countries,
            optionLabel: { trial_site_label: " ", trial_site_id: null }
        });
 
 
    CreateValidationMessage(container, "trial_site_id");
}
 
 
 
function localtrialCountryDropDownEditor(container, options) {
    $('<input name="trial_country_id"  data-text-field="country_name" data-value-field="trial_country_id" data-bind="value:' + options.field + '"/>')
        .appendTo(container)
        .kendoDropDownList({
            autoBind: false,
            optionLabel: "Select country",
            dataSource: localCountry,
            change: onChangeCountry
        });
 
 
    CreateValidationMessage(container, "countryEditor");
}
 
 
 
 
function onChangeCountry (container, options) {
 
 
    // Can i just call the editor function as in the next line of commented out code?
    // One problem here is i don't seen to access to "options" reference
    localcountryFilteredSiteLabelDropDownEditor(container, options);
 
    // Alternatively can I call a refresh method of my trial site dropdown list but I am unsure how to I get a reference to it
    to do this. I think it should be something like this in the following :
    //var trial_site_id_object = $("#trial_site_id");
    //var dropdownlist = trial_site_id_object.data("kendoDropDownList");
    //if (dropdownlist) {
    //    dropdownlist.refresh();
 
}

 

Stefan
Telerik team
 answered on 12 Jun 2018
1 answer
2.8K+ views

What is preferable way of the phone number formatting in Kendo UI MVC grid? So far I've found just one way only which is to use UIHint attribute. DataAnnotations on model class level just ignored  ([DisplayFormat(DataFormatString = "{0:###-###-####}", ApplyFormatInEditMode = true)]). Is there any other way like for date formatting?

Stefan
Telerik team
 answered on 12 Jun 2018
1 answer
838 views

This is going to be a simple one for some one . It does not seem to be passing the value to my Model .

cshtml -

            <div class="demo-section k-content">
                @(Html.Kendo().DatePickerFor(m => m.fromDate)
              .Name("datepicker")
              .Value(DateTime.Today)
              .HtmlAttributes(new { style = "width: 100%", title = "datepicker" })
                )
            </div>

Model

        [DisplayName("Date From (inclusive)")]
        public DateTime fromDate { get; set; }

Controller 

    fromDate = {1/1/0001 12:00:00 AM}

 

 

 

Georgi
Telerik team
 answered on 11 Jun 2018
1 answer
67 views

Hello,
I am considering using DateInput, but I found it’s very strange behavior. After completing month, it doesn’t move to day automatically. The only way to move is to use left/right arrows keys. Same for moving after entering day to year section. I think, it is not expected and not convenient for users. Is any configuration option I am missing?

Thank you.

Kendo example: https://demos.telerik.com/kendo-ui/dateinput/index

Jquery example that works: http://jquerytools.github.io/documentation/dateinput/index.html

Viktor Tachev
Telerik team
 answered on 11 Jun 2018
1 answer
856 views
Hello Folks,

I have used Parent-Child(Hierarchical) Kendo Grid in one of my project.

Grid contain Columns that are retrieved from database tables. Here retrieved values from the database are dynamic.

Means for 1st parent record there are 3 child columns(Type=A1) and for 2nd parent record there are 4 child(Type=A2) columns and so on.

Here data contain space, comma as well as special characters. Eg

Id | Type |  Value

1 | A1 | Standard Reference

2 | A1 | D"

3 | A1 | Family Number

4 | A2 | Material

5 | A2 | Hardness

6 | A2 | Rs in ($)

7|  A2 | Dim 7

When data binding occurs to the kendo grid then it is not binding to the kendo grid.And if i removed the space, comma & special characters binding works successfully.

Can you help me how to solve this type of problem?

Thank you.
Tsvetina
Telerik team
 answered on 11 Jun 2018
3 answers
390 views

Hi,

I have a treeview which gets data from an odata service (Sharepoint REST endpoint) using kendo.data.HierarchicalDataSource.

I am trying to get the following to work.

 

When I click on a TreeView node I want to display the complete corresponding node data in a ListView with the ability to edit and update the data like in the ListView demo for editing. Any suggestions?

 

 

 

Stefan
Telerik team
 answered on 11 Jun 2018
2 answers
1.5K+ views

I have a grid with a custom popup editor. The grid is updated manually but I want to remove the dirty indicator. On forums I found that setting the dirty property on the model to true would solve the problem. However in the below dojo you will see that it does not

https://dojo.telerik.com/OXafoRaM

What else needs to be done? Is it a requirement to also remove the dirtyfields?

Also on my application for some reason if I update two rows only one row has the dirty indicator.

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 11 Jun 2018
11 answers
460 views

I'm curious if there are any muti-sort modes? 

Our testers were confused by grids where we had enabled multi-sort, they told us the grids weren't sorting. But, the issue was they expected a single column sort and weren't aware they had to unsort the original columns in order to get that.

Other grids I have worked with that support multi-sort required some keymodifier with the click to add a column to the current sort list.

So, perhaps clicking cleared all the other sorts and Shift-Click or Ctrl-Click was used to add an additional column to the sort.

Is there such a mode as this in the kendoUI grid? If not, any one have any ideas how to handle this a bit nicer?

 

 

 

Preslav
Telerik team
 answered on 08 Jun 2018
2 answers
3.2K+ views
For the client side grid, is there a way to initially set the grid to a min-height that can be overruled if there are many rows at which point the grid would default to a larger container constraint or to the number of rows to show constraint.  The challenge here is to show the progress icon on loading.
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 08 Jun 2018
9 answers
511 views
Hello,
I am using Kendo Diagram in order to define shapes needed for my workflow application, I need to add a shape corresponding to vertical and horizontal swimlanes with the possibility to edit the text in each lane, is there any suggestion?
Thanks.
Tsvetina
Telerik team
 answered on 08 Jun 2018
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?