Telerik Forums
Kendo UI for jQuery Forum
5 answers
327 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
312 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
701 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
243 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
162 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
628 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.1K+ 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
4 answers
491 views
Hi

In following example, how can I add a simple text input field in the resources for the popup edit (or create new) rather than a dropdown field?

http://dojo.telerik.com/UkaxO/3

resources: [
    {
      field: "textinupt",
      ....???
    }
  ]

Many thanks
Vladimir Iliev
Telerik team
 answered on 03 Feb 2017
3 answers
581 views
Please suggest me that Is there any possibility of working Mouse 'On Click' events with the Kendo UI shapes.Please find the attachment of Kendo UI diagram having Shapes on it filled with color.
Eduardo Serra
Telerik team
 answered on 02 Feb 2017
1 answer
740 views

I have extended the Date Widget into my own implementation by following the online examples.  All is working nicely pretty much.

The issue I have is when the Widget is initialized twice.  We get this in production with some Anthem based controls which handle the postback and update (not Ajax). 

But I can recreate this issue simply by having the date picker on a html page with a button that calls the initialize twice.  I have created the following dojo example:

http://dojo.telerik.com/@andez2000/eHEZA/31

If you click the "Init Date Picker" button after you run the example, the width of the widget changes to 100% - not what I asked for...  You can see this getting fired inside of kendo. 

Is there a nice way not to reinitialize the date picker under these circumstances.  Ideally if I could handle this inside of kendoExtendedDatePicker.init would be good.

Thanks

 

 

 

 

 

 

 

 

Alex Hajigeorgieva
Telerik team
 answered on 02 Feb 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?