Telerik Forums
Kendo UI for jQuery Forum
1 answer
4.8K+ views

This is Kendo ASP MVC though the question is about DataSource.

Our code has two dropdowns.  When the `onchange()` for the first fires it calls `$("#classDropDown").data("kendoDropDownList").dataSource.read();` to force the second one to update.

<%: Html.Kendo().DropDownList().Name("speciesDropDown")
          .DataTextField("Text")
          .DataValueField("Value")
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetNLSSpecies", "RefData").Data("noFilters");
              });
          })
          .HtmlAttributes(new { style = "width: 50%" })
          .Filter(FilterType.Contains)
%>
...
<%: Html.Kendo().DropDownList().Name("classDropDown")
          .DataTextField("Text")
          .DataValueField("Value")
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetClassData", "RefData").Data("mergeData()");
              });
          })
          .HtmlAttributes(new { style = "width: 50%" })
          .Filter(FilterType.Contains)
%>


Elsewhere ...

$('#speciesDropDown').on('change', function (event) {
    ...
    $("#classDropDown").data("kendoDropDownList").dataSource.read();
}


The `mergeData()` function is called to provide data from the Javascript to the server.  The **problem** is that because I'm calling this as a function it is **NOT** called during the `dataSource.read()`.  But it is called initially when the page first loads.  

Obviously I could change this to `mergeData` (ie. not a function) but it is the simplest case.  I'm actually trying to pass arguments, something like:

.Data("mergeData('getSpeciesDropdownObj','getShownOrRequired(\"OtherClass\")')")


This seems like a bug to me.  Does it to you?  

I originally posted this at https://stackoverflow.com/questions/48087808/mvc-kendo-grid-read-action-datafunction-not-called-on-a-forced-datasource-re and had a conversation about though the question didn't really get answered.  (I have since been given a login so I can post here).
Stefan
Telerik team
 answered on 12 Jan 2018
2 answers
1.0K+ views

I have dropdown value and if there is value X, I want the next cell to be not editable or even better if hidden. Like shown in picture y.png.

If  there is value Y, i want the next cell to be editable. Like shown in picture x.png.

 

 

How can I achieve this? 

Georgi
Telerik team
 answered on 12 Jan 2018
7 answers
365 views

Or can it only be a number? We use GUIDs for all our identifiers so it'd be nice to be able to use a string for an id of the events in the scheduler

This would allow us to do things like mix different types onto a scheduler since we have globally unique ids

Shane
Top achievements
Rank 1
 answered on 12 Jan 2018
1 answer
195 views
Hello,
   1) I want to know how can pass data from javascript object to kendo Observable  (MVVM) defined in a function like below passing data of temp to 

var temp= "a";   // can be array ['a','b'] or simple object "a" or {"name": "a" , "address":"b"}
function foo(a, b) {
    kendo.ui.progress($("body"), true);
    
        var viewModel = kendo.observable({
                           ModelItems: new Array(),
                            TestEventListener: function (e,data) {
                                debugger;
                                viewModel.push(data);
                            },
                            pushData: function(e) {
                                debugger;
                            }
        });
}


2) Passing data between 2 in different like below passing data of to viewmodel2 

function foo(a, b) {
    kendo.ui.progress($("body"), true);
    
        var viewModel = kendo.observable({
                           ModelItems: new Array(),
                            TestEventListener: function (e,data) {
                                debugger;
                                viewModel.push(data);
                            },
                            pushData: function(e) {
                                debugger;
                            }
        });
}
function bar(a, b) {
    kendo.ui.progress($("body"), true);
    
        var viewModel2 = kendo.observable({
                           ModelItems: new Array(),
                            TestEventListener: function (e,data) {
                                debugger;
                                viewModel.push(data);
                            },
                            pushData: function(e) {
                                debugger;
                            }
        });
}



Dimitar
Telerik team
 answered on 11 Jan 2018
1 answer
104 views

I am using version 2017.3.1026.

How do I force the views to be listed in a drop down?

Thanks.

Tyler
Top achievements
Rank 1
 answered on 11 Jan 2018
5 answers
359 views

need to show google icons into gantt chart column according to the status of task. Here is my code!
var tasksDataSource = new kendo.data.GanttDataSource({
    data:DS,
        schema: {
            model: {
                id: "id",
                fields: {
                    sr: { from: "sr", type: "number" },
                    id: { from: "id", type: "string" },
                    runtimes: { from: "runtimes"}, 
                    parentId: { from: "parentId", type: "string", defaultValue: null, validation: { required: true } },
                    start: { from: "start", type: "date", format: "{0:MM/dd/yyyy}" },
                    end: { from: "end", type: "date", format: "{0:MM/dd/yyyy}" },
                    diff: { from:"diff", type: "string" },
                    title: { from: "title", defaultValue: "", type: "string" },
                    summary: { from: "summary", type: "boolean" },
                    expanded: { from: "expanded", type: "boolean", defaultValue: true }
                },
                computedRuntimes: function() {
if (this.runtimes == JSON.stringify({"included":true,"pending":true,"executed":false}) ) {
//return relevent image
}
if (this.runtimes == JSON.stringify({"included":true,"pending":true,"executed":true}) ) {
//return relevent image
}
if (this.runtimes == JSON.stringify({"included":false,"pending":false,"executed":true}) ) {
//return relevent image
}
if (this.runtimes == JSON.stringify({"included":true,"pending":false,"executed":true}) ) {
//return relevent image
}

}
            },
        }
    });

var gantt = $("#gantt").kendoGantt({

dataSource: tasksDataSource,
dependencies: dependenciesDataSource,
columns: [
            { field: "sr", title:"Sr.#", width: 60 },
            { field: "id", title: "Task ID", width: 100 },          
            { field: "computedRuntimes()", title: "Status", width: 65},
            { field: "title", title: "Title", editable: true, sortable: true },
            // { field: "start", title: "Start Time", format: "{0:MM/dd/yyyy}", width: 120, editable: true, sortable: true },
            // { field: "end", title: "End Time", format: "{0:MM/dd/yyyy}", width: 120, editable: true, sortable: true },
            { field: "diff", title: "Duration", width: 80 },
            { field: "resources", title: "Assigned Resources", editable: true }
        ],
)}

Viktor Tachev
Telerik team
 answered on 11 Jan 2018
1 answer
148 views
It doesn't seem to be possible to make the exported Excel spreadsheet look the same as the kendo spreadsheet.  Excel goes by pt whereas the browser goes by px.  So setting "defaultCellStyle": {"fontFamily": "Arial","fontSize": "12"} makes the browser spreadsheet look like I want it, but when exporting to Excel it is interpreting it as 12pt, which is a much larger font than it should be and the values in cells turn to #####.  An Arial 12px in the browser should be equivalent an Arial 9pt in Excel.

I have tried doing like "fontSize": "12pt", but that causes an error in the exported Excel file.

It seems like the best way to handle this would be to allow us to specify "fontSize": "12pt", or add like "fontUnit": "pt" so that the browser css user pt instead of px.  Or a way to specify two different defaultCellStyle fontSizes, one for browser spreadsheet and one for exports. 

See attached picture as example of browser vs export.
Veselin Tsvetanov
Telerik team
 answered on 11 Jan 2018
1 answer
114 views

The "EXAMPLE - SHOW A CUSTOM TOOL" at https://docs.telerik.com/kendo-ui/api/javascript/ui/spreadsheet#configuration-toolbar does not seem to work.  Using the preview or opening in dojo displays no custom button on the toolbar.  It looks like one might be created, but it is invisible unless you hover over the right place, and even then it is just an empty shaded square.

I am trying to add a custom button to the toolbar on spreadsheet and can't seem to get it to work either.

Ivan Danchev
Telerik team
 answered on 11 Jan 2018
11 answers
744 views

Is it possible to have multiple event templates for the Scheduler. I have a scheduler that is used for allocation work. One event type is the assignee's availability and the other events are various other work.

What I would like is to have the availability event as a thin band of colour... there does not have to be any text. The attached file shows an example of what I have achieved. What I'd like is for the green availability blocks to be just a slim green block no text is required (about a quarter of the current width).

Ivan Danchev
Telerik team
 answered on 11 Jan 2018
1 answer
399 views

I have been brought in rather late to a project and am trying to get the system stable until I can rewrite it.

We have a grid where I have set in the options

sortable: { mode: "multiple", allowUnsort: true,  showIndexes: true  }

However, we can only ever sort by a single column. No matter what I've tried, it's always a single column.

What can I look at to start troubleshooting why sorting is always single?

Robb
Top achievements
Rank 1
 answered on 10 Jan 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?