Telerik Forums
Kendo UI for jQuery Forum
1 answer
116 views

When I clicked Add or Edit button of Grid, it is centered correctly in computer.  When it is in IPAD, the popup will go to the top right corner.  I guess it could be bootstrap or accordion container of my settings.  Is there a way I can tell the popup of Add window to show in the middle or on top left corner?

Thanks.

Bertha
Top achievements
Rank 1
 answered on 26 May 2016
1 answer
1.6K+ views
I have a chart with multiple series and data set in the series.  How do I refresh the chart so that new data appears?  With the datasource the fix is dataSource.read(); dataSource.refresh(); but this does not work with series.  
Dimiter Topalov
Telerik team
 answered on 26 May 2016
3 answers
201 views

I have seen the demo where you are using SignalR and entity framework to bind to a Kendo scheduler. I have tried using this but have all sorts of problems.

  1. I am using a Edit Template with Kendo drop downs (the data for the drop downs are in Resources section but don't bind - I raised this as a separate question.
  2. I have a number of extra fields in my model. When I click to edit only the standard fields Title, Start End are bound all others have no data

Is there a way to use Linq rather than EF as I'm more familiar with this?

This is my schedular initialisation code...

////initialise scheduler
$("#scheduler").kendoScheduler({
    date: Date.now(),
    timezone: "Europe/London",
    workDayStart: new Date("2013/1/1 08:00 AM"),
    workDayEnd: new Date("2013/1/1 8:00 PM"),
    dateHeaderTemplate: kendo.template("<strong>#=kendo.toString(date, 'ddd dd/M')#</strong>"),
    selectable: true,
    messages: {
        ariaSlotLabel: "Selected from {0:g} to {0:g}",
        showWorkDay: "Show core work hours"
    },
    editable: {
        window: {
            title: "Work Request",
            width: "720px"
        },
        template: $("#customEditorTemplate").html()
    },
    height: 400,
    views: [
        { type: "day", editable: { destroy: false } },
        { type: "week", editable: { destroy: false }, eventHeight: 40 },
        { type: "timeline", editable: { destroy: false }, eventHeight: 40 },
        { type: "timelineWeek", selected: true, majorTick: 1440, minorTickCount: 1, editable: { destroy: false }, eventHeight: 40 },
        { type: "agenda" },
        { type: "month", editable: { destroy: false }, eventHeight: 40 }
    ],
    timezone: "Etc/UTC",
    dataSource: {
        type: "signalr",
        push: function (e) {
            var notification = $("#notification").data("kendoNotification");
            notification.success(e.type);
        },
        transport: {
            signalr: {
                hub: sHub,
                promise: sHubStart,
                server: {
                    read: "read",
                    create: "create",
                    update: "update",
                    destroy: "destroy"
                },
                client: {
                    read: "read",
                    create: "create",
                    update: "update",
                    destroy: "destroy"
                }
            }
        },
        schema: {
            model: {
                id: "wRequestID",
                fields: {
                    wRequestId: {
                        editable: false,
                        from: "WRequestID",
                        type: "number",
                        defaultValue: 0
                    },
                    start: {
                        from: "Start",
                        type: "date",
                        culture: "en-GB"
                    },
                    end: {
                        from: "End",
                        type: "date",
                        culture: "en-GB" },
                    diary: {
                        from: "Diary",
                        type: "object",
                        defaultValue: "UIS"
                    },
                    team: {
                        from: "Team",
                        type: "object"
                    },
                    title: {
                        from: "Title",
                        type: "string",
                        validation: { required: true }
                    },
                    workManager: {
                        from: "WorkManager",
                        type: "object"
                    },
                    assignee: {
                        from: "Assignee",
                        type: "object"
                    },
                    changeRef: {
                        from: "ChangeRef",
                        type: "string",
                        validation: { required: true }
                    },
                    activity: {
                        from: "Activity",
                        type: "string",
                        validation: { required: true }
                    },
                    impactedServers: {
                        from: "ImpactedServers",
                        type: "string",
                        validation: { required: true }
                    },
                    impactedServices: {
                        from: "ImpactedServices",
                        type: "string",
                        validation: { required: true }
                    },
                    isBAU: {
                        from: "IsBAU",
                        type: "boolean",
                        defaultValue: false
                    },
                    projectRef: {
                        from: "ProjectRef",
                        type: "string",
                        validation: { required: true }
                    },
                    notes: {
                        from: "Notes",
                        type: "string"
                    },
                    isOOH: {
                        from: "IsOOH",
                        type: "boolean",
                        defaultValue: false
                    },
                    isAllDay: {
                        from: "IsAllDay",
                        type: "boolean",
                        defaultValue: false
                    },
                    recurrenceRule: {
                        from: "RecurrenceRule",
                        type: "string"
                    },
                    recurrenceId: {
                        from: "RecurrenceID",
                        type: "number"
                    },
                    recurrenceException: {
                        from: "RecurrenceException",
                        type: "string"
                    },
                    startTimezone: {
                        from: "StartTimezone",
                        type: "string"
                    },
                    endTimezone: {
                        from: "EndTimezone",
                        type: "string"
                    }
                }
            },
        },
    },
    resources: [
        {
            field: "team",
            dataSource: [
                { text: "Team 1", value: "Team 1", color: "#f8a398" },
                { text: "Team 2", value: "Team 2", color: "#51a0ed" },
                { text: "Team 3", value: "Team 3", color: "#56ca85" }
            ],
            title: "Team"
        },
        {
            field: "workManager",
            dataSource: [
                { text: "Manager 1", value: "12345", color: "#f8a398" },
                { text: "Manager 2", value: "23456", color: "#51a0ed" },
                { text: "Manager 3", value: "34567", color: "#56ca85" }
            ],
            title: "Work Manager",
        },
        {
            field: "assignee",
            dataSource: [
                { text: "Alex", value: "12345", color: "#f8a398" },
                { text: "Bob", value: "23456", color: "#51a0ed" },
                { text: "Charlie", value: "34567", color: "#56ca85" }
            ],
            title: "Assigned To"
        }
    ],
    edit: function(e) {
        var container = e.container;
 
        /* ACTION: ADD custom button */
        var newButton = $('<a class="k-button" href="#">New button</a>');
 
        //wire its click event
        newButton.click(function(e) { alert("Clicked"); });
 
        //add the button to the container
        var buttonsContainer = container.find(".k-edit-buttons");
        buttonsContainer.append(newButton);
    }
});     

Jon
Top achievements
Rank 1
 answered on 26 May 2016
1 answer
398 views

Hi,

I am using Aurelia with Kendo UI. I tried the context menu. I am having problems in calling a function from the select. It is unable to locate that method.

$("#menu").kendoContextMenu({                
orientation: orientation,                
target: "#listview-context-menu",                
filter: ".product",                
animation: {                    
    open: { effects: "fadeIn" },                    
    duration: 500},                
select: function (e) {
   this.doAction(); // this function is not being recognized. 
}
});

 

Can you please help?

Dimiter Madjarov
Telerik team
 answered on 26 May 2016
2 answers
75 views

Hi,

I wanted to change the way to choose foreColor and backColor using the kendoColorPicker.

The default way use kendoColorPallet.

I can't find anything on internet.

Can you help ?

Philippe
Top achievements
Rank 1
 answered on 26 May 2016
1 answer
254 views

Hi,

Initially i had Grid with CRUD operations working properly and after adding sortable now sortable is working fine but CRUD  is not working

if i remove sortable crud is working fine. I need to make both working where am i making mistake

$(document).ready(function () {
                    function dataSource_change(e) {
                      var data = this.data();
                      console.log(data.length); // displays "77"
                    }
                    var dataSource = new kendo.data.DataSource({
                       //pageSize: 20,
                      transport:{
                          read:{
                            url: function() {
                              return "/makes"},
                            dataType: "json",
                            cache: false
                          },
                          update: {
                            url: function (make) {
                            console.log(make)
                            
                            return  "/makes/"+ make.models[0].id
                            },
                            type: "PUT",
                            dataType: "json",
                            beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token',jQuery('meta[name="csrf-token"]').attr("content")); }
                          },
                          destroy: {
                              url: function (make) {
                                return  "/makes/"+ make.models[0].id
                              },
                              type: "DELETE",
                              dataType: "json"
                          },
                          create: {
                              url: "/makes",
                              type: "POST",
                              dataType: "json"
                          },
                          parameterMap: function (options, operation) {
                          if (operation !== "read"  && options.models) {
                            console.log(options)
                            return{"make": options.models[0]};
                          }
                          else{
                            return {"make":options};
                            }
                          }
                      },
                      batch: true,
                       schema: {
                           model: {
                             id: "id",
                             fields: {
                                id: { editable: false, nullable: true },
                                name: { validation: { required: true } },
                             }
                           }
                       }
                    });
                    dataSource.bind("change", dataSource_change);
                    dataSource.fetch();

                    var grid = $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: false,
                        height: 550,
                        toolbar: [{name: "create", text: "Add New Make"}],
                        columns: [
                            { field:"name",title:"Makes" },                                      
                            { command: ["edit", "destroy"], title: "Action", width: "250px" }],
                        editable: "inline"
                    }).data("kendoGrid");
                    grid.table.kendoSortable({
                        filter: ">tbody >tr",
                        hint: $.noop,
                        cursor: "move",
                        placeholder: function(element) {
                            return element.clone().addClass("k-state-hover").css("opacity", 0.65);
                        },
                        container: "#grid tbody",
                        change: function(e) {
                            console.log(grid)
                            var skip = grid.dataSource.skip(),
                                oldIndex = e.oldIndex + skip,
                                newIndex = e.newIndex + skip,
                                data = grid.dataSource.data(),
                                dataItem = grid.dataSource.getByUid(e.item.data("uid"));
                            var updated_order = []
                            $('tbody tr').each(function(i){
                              updated_order.push({ name: $(this).children('td:first').text(), position: i+1 });
                            });
                            controller_name = $('#controller_name').val();
                            $.ajax({
                              type: "PUT",
                              url: '/sort',
                              data: { order: updated_order, controller_name: controller_name }
                            });

                            grid.dataSource.remove(dataItem);
                            grid.dataSource.insert(e.newIndex, dataItem);
                        }
                    });

                });

Alexander Valchev
Telerik team
 answered on 26 May 2016
2 answers
487 views

Hi,

I'm trying to pass in DataSourceRequest instance to a web api method (POST), and can't find the model binder for it.

Here's my scenario in short:

1) Kendo Grid uses MVC controller action to get the data, and DataSourceRequest is binded ok.

2) In turn, the MVC action needs to call a web api url (using post), and include the DataSourceRequest as content (json format)

 

I checked this article: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/web-api-server-operations

But it only discusses the GET request, and when grid is directly calling web api.

 

Is there a json model binder for DataSourceRequest, for web api?

Vladimir Iliev
Telerik team
 answered on 26 May 2016
1 answer
134 views

hello there

is there a way to convert a normal kendo DataSource to a HierarchicalDataSource

I´m trying to create a function that gets all the child elements from the datasource but it´s hard when there is grouping involved in the datasource

 

or do you have some kind of function that gets all the lowest child nodes that are in the normal datasource

 

best regards from Iceland

Nikolay Rusev
Telerik team
 answered on 26 May 2016
2 answers
1.2K+ views

Is there a way to use a contains filter on a grid column that is using the 'values' lookup attribute? I've noticed with filterable:true option that it does not include a contains option by default. I have a column defined in the columns section of grid options:

{ field: "sampleId", title: "Sample Item", width:165, values: sampleListLookup },

Later a filter as:

filter.push({
           logic: 'or',
           filters:[
{ field: 'sampleId', operator: 'contains', value: $scope.filters.searchString },

However, when I try this is give an error in the Int stored in the column instead of filtering on string values that match the Id key. The logic works very well for string columns, just not the string look-ups above.

Looking for ideas on a work around or is it going to end up being a server side query? Perhaps filtering the lookup lists and passing in the resulting list to the filter?

Tim
Top achievements
Rank 1
 answered on 25 May 2016
4 answers
343 views
How can i define a data-template with a source binding using the useWithBlock:false

I have something like the following
<ul data-template="itemtemplate" data-bind="source: Data">

and my template
<script id="itemtemplate" type="text/x-kendo-template">
  <li>
    <div>
      <label data-bind="text: Description">
      </label>
    </div>
  </li>
</script>

but I want that my template will be rendered with the useWithBlock property set to false

Dani
Top achievements
Rank 2
 answered on 25 May 2016
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
Application
Map
Drag and Drop
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
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
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
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?