Telerik Forums
Kendo UI for jQuery Forum
9 answers
612 views
Hi! Could you provide me small example to bind model member (boolean) to Switch widget state.
I would expect something like
<input data-role="switch" data-bind="checked:checked"/>

But it looks terrible and does not work. Another question: why after binding my Tabstrip looks "doubled"
http://jsfiddle.net/GewUa/5/ 
Konstantin Dikov
Telerik team
 answered on 02 Jul 2018
1 answer
86 views

Hi All

I have a grid that is getting generated by means of a HTML table. I would like to know or understand how I can filter the grid data especially the Date Fields and numeric fields. I checked most of the examples, they are all based on oData data source. I did not come across any examples where date/numeric filtering is done in the grid which gets generated by means of  HTML table.

Thank You in advance for your inputs.

Vijhay Devarajan.

Viktor Tachev
Telerik team
 answered on 02 Jul 2018
1 answer
917 views

I am running into an issue when adding a dropdownlist to my grid in my detailInit grid. When I select a row, the dropdownlists are in there, but when I select another row, then the dropdownlist's don't appear.
However, if I select the 3rd row, I get the dropdownlists appearing and they will appear in the 2nd and 1rst row, but not the fourth.
Why is this happening and how do I fix it so that regardless which row I select, that all the rows will have the dropdownlists?

Below is my testing code

 

<script type="text/x-kendo-template" id="EditAreaGridToolbarTemplate">
        <button class="btn btn-sm btn-primary" id="btnAddNewArea"><i class="fa fa-plus"></i></button>
        <button id="btnDeleteArea" class="btn btn-sm btn-danger"><i class="fa fa-remove"></i></button>
    </script>
    <div id="TabEditor"></div>
 
var dropdownData = [{
    "CatalogID": 1,
    "NameVersion": "Catalog1"
  },
  {
    "CatalogID": 2,
    "NameVersion": "Catalog2"
  },
  {
    "CatalogID": 3,
    "NameVersion": "Catalog3"
  },
  {
    "CatalogID": 4,
    "NameVersion": "Catalog4"
  },
];
 
$(document).ready(function() {
 
  //#region Data
 
  var data2 = [{
      "RoomID": 1,
      "RoomName": "Room 1",
      "Areas": [{
        "id": 1,
        "AreaName": "Area 1"
      }, {
        "id": 10,
        "AreaName": "Area 10"
      }]
    },
    {
      "RoomID": 2,
      "RoomName": "Room 2",
      "Areas": [{
        "id": 2,
        "AreaName": "Area 2"
      }, {
        "id": 20,
        "AreaName": "Area 20"
      }]
    },
    {
      "RoomID": 3,
      "RoomName": "Room 3",
      "Areas": [{
        "id": 3,
        "AreaName": "Area 3"
      }, {
        "id": 30,
        "AreaName": "Area 30"
      }, {
        "id": 35,
        "AreaName": "Area 35"
      }]
    },
    {
      "RoomID": 4,
      "RoomName": "Room 4",
      "Areas": [{
        "id": 4,
        "AreaName": "Area 4"
      }, {
        "id": 40,
        "AreaName": "Area 40"
      }]
    }
  ];
 
  //#endregion
 
  ShowTabEditor(data2);
});
 
function ShowTabEditor(data) {
  $('#TabEditor').kendoGrid({
    dataSource: {
      data: data
    },
    schema: {
      model: "RoomID",
      fields: {
        RoomID: {
          editable: false,
          hidden: true
        },
        RoomName: {
          editable: false,
          type: "string",
          hidden: false
        },
        AreaCount: {
          editable: false,
          type: "number",
          hidden: false
        }
      }
    },
    columns: [{
        field: "RoomID",
        title: "RoomID",
        hidden: true
      },
      {
        field: "RoomName",
        title: "RoomName",
        hidden: false
      },
      {
        field: "AreaCount",
        title: "AreaCount",
        hidden: false
      }
    ],
    selectable: "row",
    //change: onTabEditorRowSelect,
    //detailTemplate: kendo.template($("#TabAreaTemplate").html()),
    detailInit: TabEditorDetailInit,
    detailExpand: function(e) {
      this.select(e.detailRow.prev());
      this.collapseRow(this.tbody.find('> tr.k-master-row').not(e.masterRow));
    }
  }).data("kendoGrid");
}
 
function TabEditorDetailInit(e) {
  //var masterRow = e.masterRow;
  //var roomID = e.data.RoomID;
 
 
  $("<div id='EditAreaGrid' />").appendTo(e.detailCell).kendoGrid({
    scrollable: true,
    sortable: true,
    selectable: "row",
    filterable: false,
    toolbar: kendo.template($("#EditAreaGridToolbarTemplate").html()),
    columns: [{
      title: "id",
      field: "id",
      hidden: true
    }, {
      field: "AreaName",
      title: "Area Name",
      width: "20px",
      template: "<div >#=AreaName #</div>"
    }, {
      title: "Catalog",
      field: "Catalog",
      template: "<input class='edit-area-catalog-dropdown' type='text' />",
      width: "40px",
      editable: false
    }],
    editable: {
      mode: "incell",
      confirmation: false
    },
    dataSource: {
      data: e.data.Areas,
      schema: {
        model: {
          fields: {
            id: {
              nullable: true
            },
            AreaName: {
              nullable: true,
              editable: true
            },
            Catalog: {
              editable: false
            }
          }
        }
      }
    },
    dataBound: function(e) {
      abindCatalogDropDownInCellProcess();
    }
  });
}
 
function abindCatalogDropDownInCellProcess() {
  $("#EditAreaGrid").data("kendoGrid").tbody.find("td input.edit-area-catalog-dropdown").each(function() {
    $(this).kendoDropDownList({
      dataTextField: "NameVersion",
      dataValueField: "CatalogID",
      optionLabel: "Select Catalog...",
      dataSource: {
        transport: {
          read: function(options) {
            if (dropdownData.length > 0) {
              options.success(dropdownData);
              return;
            }
 
            options.success(dropdownData);
          }
        }
      },
      select: function(e) {
        var grid = $("#EditAreaGrid").data("kendoGrid");
        var dataItem = grid.dataItem(grid.select());
        var drpDataItem = this.dataItem(e.item);
      }
    });
  });
}
Preslav
Telerik team
 answered on 02 Jul 2018
5 answers
108 views

Hi, the latest feature to allow an overnight view is great and I have used it for shift working from 7PM to 7AM. 

Is there a way to highlight the midnight timeline and make it bolder/ different colour.. similar to the attached visual (albeit with a straighter line :) )

Veselin Tsvetanov
Telerik team
 answered on 02 Jul 2018
1 answer
211 views

Hi.

The REST-Api server is written with flask and python. 

and Server's request parser require the following dictionary format asking PUT method.

{
    "uuid": 15,
    "subject": "newfile uploaded..",
    "filepath": "newfile.zip",
    "description": "ev3 install version : 1.4.1",
    "count": 3
}

I've tested GET/POST/PUT/DEL method with POSTMAN and that's no problems.

However, When I ask PUT method using 'kendoui-gridedit-popup' there occurs some prolblems. 

I've found the reason of it. That's the parameterMap's object and its format is not matched with my flask server's requirement.

 

when I request 'EDIT(PUT method)' with the kendoui library, the sending object's message is like the followings.

       nodes: [{"count":1,"description":"ev3 install version : 1.4.1","filepath":"moba.zip","subject":"mobasss","uuid":3}]

Um...

I wish to convert the format matching with my server and I have to remove '[', ']' .

How can i do that? Let me know the solution.

 

$(document).ready(function () {
                var crudServiceBaseUrl = "http://www.learnsteam.kr:5000",
                    dataSource = new kendo.data.DataSource({
                        transport: {
                            read: {
                                url: crudServiceBaseUrl + "/nodes",
                                dataType: "json"
                            },
                            update: {
                                url: crudServiceBaseUrl + "/node/put",
                                dataType: "json",
                                type: "POST"
                            },
                            destroy: {
                                url: crudServiceBaseUrl + "/node/delete",
                                dataType: "json",
                                type: "POST"
                            },
                            create: {
                                url: crudServiceBaseUrl + "/node/post",
                                dataType: "json",
                                type: "POST"
                            },
                            parameterMap: function (options, operation) {
                                if (operation !== "read") {
                                    console.log("Here parameterMap");
                                    console.log(options);
                                    return {nodes:kendo.stringify(options.models)};
                                    //return json.stringify(options.models);
                                    //msg==>  nodes: [{"count":1,"description":"ev3 install version : 1.4.1","filepath":"moba.zip","subject":"mobasss","uuid":3}]
                                }
                            }
                        },
                        batch: true,
                        pageSize: 10,
                        schema: {
                            data: "nodes",
                            model: {
                                id: "uuid",
                                fields: {
                                    uuid: { editable: false, nullable: true },
                                    subject: { validation: { required: true } },
                                    filepath: { type: "string", validation: { required: true } },
                                    description: { type: "string" },
                                    count: { type: "number", validation: { min: 1, required: true } }
                                }
                            }
                        }
                    });
 
                $("#grid").kendoGrid({
                    dataSource: dataSource,
                    pageable: true,
                    height: 550,
                    toolbar: ["create"],
                    columns: [
                        { field: "uuid", title: "ID", width: "120px" },
                        { field: "subject", title: "제목", width: "400px" },
                        { field: "filepath", title: "파일 경로", width: "400px" },
                        { field: "description", width: "120px" },
                        { field: "count", width: "100px" },
                        { command: ["edit", "destroy"], title: " ", width: "250px" }],
                    editable: "popup"
                });
            });

 

 

 

Stefan
Telerik team
 answered on 02 Jul 2018
1 answer
55 views

````

$("#grid").kendoGrid({
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"
                    },
                    pageSize: 15
                },
                height:600,
                groupable: true,
                sortable: true,
                pageable: {
                    refresh: true,
                    pageSize: 15,
                    pageSizes: [15,30,50,'all'],
                    buttonCount: 5
                },
                columns: [{
                    template: "<div class='customer-photo'" +
                    "style='background-image: url(https://demos.telerik.com/kendo-ui/content/web/Customers/#:data.CustomerID#.jpg);'></div>" +
                    "<div class='customer-name'>#: ContactName #</div>",
                    field: "ContactName",
                    title: "联系人",
                    width: 210
                }, {
                    field: "ContactTitle",
                    title: "职位"
                }, {
                    field: "CompanyName",
                    title: "公司"
                }, {
                    field: "Country",
                    title: "国家",
                    width: 150
                }]
            });

```````

Stefan
Telerik team
 answered on 02 Jul 2018
1 answer
214 views

TLDR: I want to draw a trend line on a stock chart.

I would like to be able to draw arbitrarily on the stock chart in an on render method, as well as in the series configuration of the chart, based on the charts data points.

I am wanting to use the kendoStockChart of type candlestick with ohlc data provided as a remote datasource, and plot a trend line by providing another series of type line. This second series is not rendered, unless I change the object to be kendoChart, in which case I lose the required stock chart features such as zoom and visualisation.

Is there any way to achieve what I am describing please?

Tsvetina
Telerik team
 answered on 29 Jun 2018
4 answers
464 views

Hi everyone, 

We have special requirements to enable multiple row selection on Gantt. Idea is that we select a few tasks and propagate information further into directives and enable some sort of bulk change. 

Is it possible to achieve this and how?

Thanks

Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
 answered on 29 Jun 2018
1 answer
65 views

Hello,

Can someone supply a current, up to date documentation for the Switch widget?

In my own research, I am finding very little info on how to use the Switch widget with MVVM. What little info I find is contradictory or incomplete, like this https://www.telerik.com/forums/kendo-mobile-switch-not-updating-viewmodel

 

Then I found this resource, which is definitely incomplete. It is also false, because I can't get any events to fire.

https://demos.telerik.com/kendo-ui/m/switch/mvvm.

 

I am in the process of converting the checkboxes of my app to switches, as per client. I am using traditional inputs, klendo dropdowns, kendo autocomplete, etc. Everything is initialized via mvvm. But for some reason, the switch widget is not working, as none of my events are binding. I must be able to listen to a change or click event, but no luck. How do i bind to the change event on a switch widget?

 

Also, could you include the CSS of the switch widget with the rest of the kendo widgets? If the switch widget is in the kendo javascript file by default, shouldn't the default css files also include the switch widget?

Plamen
Telerik team
 answered on 29 Jun 2018
1 answer
4.0K+ views

I created a separate class in .js file to create grid for me,my class is simple as following:

 

function createDynamicGrid(chartId, source, column, titleOfGrid,onChange) {
        chartId.kendoGrid({
        toolbar: titleOfGrid,
        dataSource: {
            data: source,
        },
       change: onChange,
        height: 350,
        scrollable: true,
        sortable: true,
        filterable: true,
        columns: column,
        noRecords: {
            template: "No data"
        },
        });
}

 

in my cshtml file ,i call the above class ,pass the parameters and get the grid,but the onChange event does not trigger :

createDynamicGrid($("#grid"), dataSource, clmns, change);

function onChange(e){

 

//here i should get the clicked event ,but cant!

}

 

 

 

Alex Hajigeorgieva
Telerik team
 answered on 29 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?