Telerik Forums
Kendo UI for jQuery Forum
3 answers
881 views

Each of our treelists contains an Id column that uniquely identifies the row's object.  Our first implementation was rather straightfoward in that we simply got the Id from what we know is the correct column (based on static column ordering):

 

var row = $(event.currentTarget).closest("tr");
var versionId = parseInt(row[0].cells[1].childNodes[1].data);

 

However, since our users are able to reorder the columns, we're unable to hard-code the cell in order to find the Id of the selected row.

Given a row, how do we find which column is the "Id" column?

Stefan
Telerik team
 answered on 03 Feb 2017
7 answers
703 views

Hello,

In scheduler's day view, when I create an event that starts for example at 10:00 AM and ends at 10:00 AM the next day, the event is created, but I can't see this event in the scheduler. You can try this behavior also in this scheduler demo: http://demos.telerik.com/kendo-ui/scheduler/restriction

I know that I can set allDaySlot field to true and see the event at the top row of the scheduler, but I want to see the event inside the scheduler, between the other events.

I have read that it's possible to achieve this by creating a custom view, but I haven't found any source code with a custom view that would solve my problem. Could anybody send me a code that would help me with this?

Thanks for replies,

Boris

Ivan Danchev
Telerik team
 answered on 03 Feb 2017
8 answers
308 views

I am trying to export a view in my SPA using the kendo drawing api.  One of the elements on this view is a tabstrip and I would like to export all of the different tab contents, not just the active one.

I found this post about printing the tabstrip and was thinking I would have to do something like that in my code.  This is the export to PDF button click event handler code.  This seems to mostly work, only I don't know how to put the tabstrip back the way it was before I made all of the content blocks visible.

e.preventDefault();
$("#pageContainer .k-tabstrip .k-content").css("display", "block");  // Show all the tabstrip content blocks
$("#span.tabHeader").css('display', 'block'); // Show the tab header span
 
kendo.drawing.drawDOM($("#pageContainer")).then(function (group) {
  return kendo.drawing.exportPDF(group, {
    paperSize: 'auto',
    margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
  });
})
.done(function (data) {
  kendo.saveAs({
    dataURI: data,
    fileName: kendo.format('Item - {0}.pdf', viewModel.selectedItem.item)
  });
});
 
// Not really sure how to put the tabstrip back together
$("#pageContainer .k-tabstrip .k-content").css("display", "none");
 
$("#span.tabHeader").css('display', 'none');  // Hide the tab header spans

Plamen
Telerik team
 answered on 03 Feb 2017
5 answers
261 views

Hello, 

I'm trying to adda new task programmatically based on the value of exiting drop down list. The I have is when creating a dependency between newly created tasks. the successorId and the predecessorId are both equal to 0.I checked at the server side, I'm returing the new ID, and at the client side, when checking the content of the dataSource, Ids are up to date with the returned value. 

 

Here is the code. Am missing something?

 

<script type="text/x-kendo-template" id="toolbarTemplate">

    <div>
        <input id="types" style="width:250px"/>
        <a class="k-button k-button-icontext k-add" href="#" id="AddButton" onclick="addType()" role="option" data-bind="value"><span class="k-icon k-i-add"></span>Add type</a>
    </div>

</script>


<div>

    @(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>()
          .Name("gantt")
          .Columns(columns =>
          {
              columns.Bound(c => c.Id).Title("ID").Width(50);
              columns.Bound(c => c.ShortCode).Title("Short code").Editable(false).Width(50);
              columns.Bound(c => c.Title).Editable(false).Sortable(true);
              columns.Bound(c => c.Start).Title("Start Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(true).Sortable(true);
              columns.Bound(c => c.End).Title("End Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(true).Sortable(true);
          })
          .Views(views =>
          {
              views.DayView();
              views.WeekView(weekView => weekView.Selected(true));
              views.MonthView();
          }).Tooltip(tooltip => tooltip.Template("#= task.title #"))
          .Height(500)
          .Date(DateTime.Now)
          .DataSource(d => d
              .Model(m =>
              {
                  m.Id(f => f.Id);
                  m.OrderId(f => f.OrderId);
              })
              .Read("ReadTasks", "Gantt")
              .Create("CreateTask", "Gantt")
              .Destroy("DestroyTask", "Gantt")
              .Update("UpdateTask", "Gantt")
          )
          .DependenciesDataSource(d => d
              .Model(m =>
              {
                  m.Id(f => f.DependencyID);
                  m.PredecessorId(f => f.PredecessorID);
                  m.SuccessorId(f => f.SuccessorID);
                  m.Type(f => f.Type);
              })
          .Read("ReadDependencies", "Gantt")
          .Create("CreateDependency", "Gantt")
          .Destroy("DestroyDependency", "Gantt")
          )
          //.Events(events => events.Edit("edit").Add("add"))
          )
</div>


<style>
    
    .k-task-draghandle {
         display: none !important;
     }

    /*.k-gantt .k-gantt-actions:last-child {
        visibility: hidden;
    }*/

</style>

<script>

    function addType() {
        var gantt = $("#gantt").data("kendoGantt");
        var task = getNewTask();
        var taskNew = new kendo.data.GanttTask(task);
        gantt.dataSource.add(taskNew);
        gantt.dataSource.sync();
    }

    function getNewTask() {
        var combobox = $("#types").data("kendoDropDownList");
        var item = combobox.dataItem();

        var task = {
            id: -1,
            orderId: 0,
            parentId: null,
            title: item.Name,
            code: item.code,
            start: new Date($.now()),
            end: new Date((new Date()).valueOf() + 2 * 1000 * 3600 * 24),
            typeId: item.Id,
            percentComplete: 0,
            type: "Task"
        };

        return task;
    }

    $(document).ready(function () {

        $($(".k-gantt-actions")[1]).css("visibility", "hidden");
        $($(".k-gantt-actions")[0]).html($("#toolbarTemplate").html());

        $("#types").kendoDropDownList({
            dataTextField: "Name",
            dataValueField: "Id",
            filter: "contains",
            dataSource: {
                transport: {
                    read: {
                        dataType: "json",
                        url: "@Url.Action("GetAllTypes", "Type")",
                    }
                }
            }
        });

        $(document).bind("kendo:skinChange", function () {
            gantt.refresh();
        });
    });

    //function edit(e) {
    //    $($(".k-edit-label")[0]).hide();
    //    $($(".k-edit-field")[0]).hide();
    //    $($(".k-edit-label")[$(".k-edit-label").size() - 1]).hide();
    //    $($(".k-edit-field")[$(".k-edit-field").size() - 1]).hide();
    //}


    //function add(e) {

    //    //console.log(e.dependency.successorId + " : " + e.dependency.predecessorId);
    //    //console.log(e);

    //    try {
    //        //if(e.dependency.successorId == e.dependency.predecessorId)
    //        //  e.preventDefault();

    //        //var gantt = $("#gantt").data("kendoGantt");
    //        //gantt.data

    //    } catch (e) {

    //    }
    //}

</script>

Plamen
Telerik team
 answered on 03 Feb 2017
4 answers
263 views

Hi, 

I cant find a method for changing the content of textBlock text appended to a shape. In this demo: http://dojo.telerik.com/IDEnA , there is a method for changing the color of the shape, is there a similar method to change the textBlock text. any help ? thank you.

Fahd
Top achievements
Rank 1
 answered on 03 Feb 2017
3 answers
647 views

I want to get the Id of the newly created task after the task has been successfully created. So, I am trying to get use the 'RequestEnd' event of dataSource to check if the event is of type 'create' and if the task id has been returned.

Please see this snippet. and create a new task. It seems that there is no taskId present in the response.

Ivan Danchev
Telerik team
 answered on 03 Feb 2017
2 answers
186 views

When displaying a lot of events in the cell in MonthView, only 2 are being displayed and a button that displays the Day View with all the events. Is there a way to display all the events in MonthView?

Check the following scenario:

1. Go to: http://dojo.telerik.com/OmugE

2. Navigate to 14 of May 2013.
3. Add all day events starting from 10 of May until the 14 of May.(No Title1, No Title2)
4. Add all day event starting and ending on 14 of May.(No Title3)
5. Navigate to 14 of May 2013 and change the end date of NoTitle3 event to 17 of May.
(Make sure you have marked the events as all day)
6. Only "No Title1" and "No Title2" are displayed and not "No Title3" (I know there is a button that will display all the events in Day View)

Ivan Danchev
Telerik team
 answered on 03 Feb 2017
1 answer
123 views

I need to create a custom GanttView for my gantt.  I have seen the examples, but cannot find any examples for .NET MVC. 

How do you add a custom view to a gantt in MVC?

Thanks,

Justin

Bozhidar
Telerik team
 answered on 03 Feb 2017
1 answer
577 views

I have a scheduler with multiple people's schedules on it, each person has their own event color on the scheduler. I have a multiselector that lets me filter who's schedules I see on the scheduler. However, I want to change the tabs of those I select from the multiselect to have a background color that matches their event color. 

 

So far, I have <div id="nameDiv" style="background-color: #:data.color#">#:data.text#</div> in my tagTemplate field in my multiselector. All this does is add a background to where the text is at inside the tag, leaving the ends of the tag to be uncolored. I want the backgrounds of the entire tag set to specific colors not attached to the text inside the tag.

 

Does anyone know how to go about doing this? I was thinking if I could access the specific class that handles tag styling, but I cannot find what that is called anywhere...

Alex Hajigeorgieva
Telerik team
 answered on 03 Feb 2017
1 answer
2.0K+ views

I am using the Aurelia bridge and have issues when clearing the mullti select.

Clearing the selected values, by clicking the little 'x' to the right in the compopnent, doesn't seem to fire an event.

The API for the multiSelect describes the select/deSelect events but nothing for clear.

Am I missing something? Sholdn't it emit a change event?

 

Cheers,

Henrik Valerian

Dimiter Topalov
Telerik team
 answered on 03 Feb 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?