Telerik Forums
Kendo UI for jQuery Forum
4 answers
746 views

Using the Kendo Grid javascript, how do I set the width of the filter drop down in the grid header when there are long texts in the drop down?  Basically I do not want wrapping, but at the same time, I do not want to increase the column width.

The length needs to approximately match the length of the longest text.

 

S.Ahmadi
Top achievements
Rank 1
 answered on 01 Dec 2019
2 answers
126 views

Hi, 

Im having trouble displaying a list of initial files in the Upload widget. In this dojo (https://dojo.telerik.com/EtuxIgeM) I've set the initial files and they display, but if I remove the 'async' attribute, my files are no longer displayed.

I dont use the upload widget for Async uploading so I dont have these attributes. Please advise.

Thanks, 
Grant

Martin
Telerik team
 answered on 29 Nov 2019
1 answer
292 views

I want to extract EndDate from Recurrence Rule Editor. I am able to get the EndDate when the user selects datepicker from radioButton but I am not able to find the EndDate when the user selects occurrence(s) or never radiobutton .

 

var editor = $("#RecurrenceRule").data('kendoRecurrenceEditor');
var endDate = editor._until.value();

 

The above gives me EndDate from Recurrence Editor. But gives wrong date when occurrence and never is selected.

Is there any function which can give me the EndDate? or is there any property in the KendoRecurrenceEditor which stores this date? or is there any other way where i can evaluate the StartDate and Rule to get the EndDate ?

Thank you!

Aleksandar
Telerik team
 answered on 29 Nov 2019
1 answer
136 views

Following on from my previous posts (here and here)

My scheduler has a timeline view where the user can specify his start and end times according to which shift they are on. The choices are Early (08:00 - 14:00), Late (14:00 - 22:00), Nights (22:00 - 06:00) or full day (00:00 to 23:59). I have discovered that the code in the linked posts will only work if the view is full day.

In order to try and figure out what is causing this I placed some console.log lines as so:

//Make the scheduler a drop area for drag and drop.
    function createDropArea(scheduler) {
 
        var grid = $("#grid").data("kendoGrid");
 
        scheduler.view().content.kendoDropTargetArea({
            filter: ".k-scheduler-table td, .k-event",
            drop: function (e) {
 
                var offset = $(e.dropTarget).offset();
                console.log('drop target: %0', $(e.dropTarget));
                var slot = scheduler.slotByPosition(offset.left, offset.top);
                console.log('slot startDate: ' + slot.startDate);
                console.log('slot start time: ' + slot.startDate.getTime());
                var slotResource = scheduler.resourcesBySlot(scheduler.slotByElement($(e.dropTarget)));
                console.log('slotResource: %0', slotResource.assignee);
                var dataItem = grid.dataItem(grid.select());
                var eventStart = slot.startDate;
                var eventEnd = new Date(slot.startDate.getTime() + (dataItem.end - dataItem.start));
                console.log('event start time: ' + eventStart);
                console.log('event end time  : ' + eventEnd);
 
                if (dataItem && slot) {
                    var offsetMiliseconds = new Date().getTimezoneOffset() * 60000;
                    var newEvent = {
                        eID: -1,
                        eClonedID: 0,
                        status: dataItem.status,
                        assignee: slotResource.assignee,
                        title: dataItem.title,
                        start: eventStart,
                        end: eventEnd,
                        requestType: dataItem.requestType,
                        lastUpdatedBy: $UserID,
                        isEvRecurring: dataItem.isEvRecurring,
                        isAllDay: dataItem.isAllDay,
                        startTimezone: dataItem.startTimezone,
                        endTimezone: dataItem.endTimezone,
                        clearNotes: dataItem.clearNotes,
                        resetToPlanned: dataItem.resetToPlanned,
                        replicateRecurrence: dataItem.replicateRecurrence,
                        moveDiff: dataItem.moveDiff,
                        deleteRecurring: dataItem.deleteRecurring
                    };
 
                    scheduler.dataSource.add(newEvent);
 
                    //clear selected row so that we don't have the issue of
                    //selected items being added when we are cloning or moving events.
                    grid.clearSelection();
                }
 
            }
        });
    }

 

When the scheduler that shows the full day and I drag & drop onto the 09:00 slot the console outputs....

drop target: %0 jQuery.fn.init [td..k-nonwork-hour]
TEST:2089 slot startDate: Tue Nov 26 2019 09:00:00 GMT+0000 (Greenwich Mean Time)
TEST:2090 slot start time: 1574758800000
TEST:2092 slotResource: %0 138
TEST:2096 event start time: Tue Nov 26 2019 09:00:00 GMT+0000 (Greenwich Mean Time)
TEST:2097 event end time  : Tue Nov 26 2019 10:30:00 GMT+0000 (Greenwich Mean Time)

This will render the event correctly.

When the scheduler is showing just 06:00 to 14:00 and I drag & drop onto the 09:00 slot the console outputs....

drop target: %0 jQuery.fn.init [td]
TEST:2089 slot startDate: Tue Nov 26 2019 09:00:00 GMT+0000 (Greenwich Mean Time)
TEST:2090 slot start time: 1574758800000
TEST:2092 slotResource: %0 138
TEST:2096 event start time: Tue Nov 26 2019 09:00:00 GMT+0000 (Greenwich Mean Time)
TEST:2097 event end time  : Tue Nov 26 2019 10:30:00 GMT+0000 (Greenwich Mean Time)

Here the event is not rendered at all.

The only difference I can see is the drop target. On the one that works we have drop target: %0 jQuery.fn.init [td..k-nonwork-hour] while on the one that does not we have drop target: %0 jQuery.fn.init [td]

Totally lost on this one... any help appreciated.

 

Ivan Danchev
Telerik team
 answered on 29 Nov 2019
3 answers
310 views
Hi,
when using kendo grid with filter in the headers and put the filter to filter in "contains" and not by "starts with" the dropdown suggestion goes always by "starts with".
I can consider this a bug, not a big deal but still it has raised bug tickets in our development environment and it seems something that could be fixable.

Example:
http://demos.telerik.com/kendo-ui/grid/filter-row

In "Ship Name" change the type of filter to "Contains" and start typing some text that would match that "contains" and not just "starts with".
Ivan Danchev
Telerik team
 answered on 28 Nov 2019
1 answer
205 views

Hi Telerik,

 

Does pivot grid has ability to enable this mode?

If yes, can you share sample code.

Tsvetomir
Telerik team
 answered on 28 Nov 2019
8 answers
1.7K+ views
Howdy All,
While binding to an array source is it possible to determine the index of the current array element? 

The documentation for using the Source binding gives the following example:

<ul data-template="ul-template" data-bind="source: products">
</ul>
<script id="ul-template" type="text/x-kendo-template">
    <li>
        id: <span data-bind="text: id"></span>
        name: <span data-bind="text: name"></span>
    </li>
</script>
<script>
    var viewModel = kendo.observable({
        products: [
            { id: 1, name: "Coffee" },
            { id: 2, name: "Tea" },
            { id: 3, name: "Juice" }
        ]
    });
 
    kendo.bind($("ul"), viewModel);
</script>


What I'm trying to do is get a reference to the index of the current array element from within the template.
For Example:

<li>
        index: <span data-bind="text: index"></span>
        id: <span data-bind="text: id"></span>
        name: <span data-bind="text: name"></span>
</li>

Does anybody know if there's a way to get access to the index from within the template?

Any insight would be greatly appreciated. 
Thanks in advance
Seamus
John
Top achievements
Rank 1
 answered on 28 Nov 2019
1 answer
136 views
Hello,

I have kendo treeview in my MVC project. Treeview context menu was showed well in IE by right mouse clicking, but in Firefox the treeview context menu was covered by page default context menu. Could someone have the tip to resolve the context menu issue with Firefox?  Below are pieces of code for context menu. Attached image is context menu showed in IE and Firefox.

Thanks in advance.

...
    function CreateContextMenu(targetTree) {
        var cxtMenuUl = $('#treeViewContextMenu');
        cxtMenuUl.css("white-space", "nowrap");
        if (cxtMenuUl) {
            cxtMenuUl.kendoContextMenu({
                // listen to right-clicks on treeview container
                target: targetTree,
                dataSource: getContextData(),
                orientation: "vertical",
                select: selectFolderContextMenu,
                filter: ".k-state-selected",
                open: onOpenLeftContextMenu
            });
        }
    }

     function getContextData () {
        var data = [{ text: 'Delete', attr: { id: 'delete' } },
                { text: "", cssClass: "k-separator" },
                { text: 'Rename', attr: { id: 'rename' } },
                { text: "", cssClass: "k-separator" },
                { text: 'New Folder', attr: { id: 'newfolder' } },
                { text: "", cssClass: "k-separator" },
                { text: 'Upload', attr: { id: 'upload' } }];

        return data;
    }
...
Dimitar
Telerik team
 answered on 26 Nov 2019
10 answers
879 views

I have in my form an autocomplete box and a combobox.  I don't populate the comobox box until a selection is made in the autocomplete box.  This has been working fine, but I don't want the user to be able to type in the combobox so I am converting it to a dropdownlist.  After I made the change, my dropdownlist dissapears after the autocomplete box change event fires.  I stripped the code down so all it is doing is re-initializing the dropdownlist, and it still does the same thing.  Here is the code for my autocomplete box:

$("#matterCombo").width(300).kendoAutoComplete({
        minLength: 0,
        autoBind: false,
        dataTextField: "text",
        dataSource: {
            serverPaging: true,
            serverFiltering: true,
            pageSize: 5,
            transport: {
                read: {
                    url: "wsRest.svc/matters/",
                    data: {
                        client: function () {
                            return $("#clientCombo").val();
                        },
                        value: function () {
                            return $("#matterCombo").val();
                        }
                    } //data
                } //read
            } //trans
        }, //ds
        change: function () {
            $("#custom1Combo").kendoDropDownList();
        }
    });

The form loads fine, but when the change event fires, custom1Combo dissapears.

When the page loads, the dropdownlist is initialized like this:

$("#custom1Combo").width(300).kendoDropDownList();

The initial initialization is working fine and I am even able to fill in a default value, but then when I try to update it later it just dissapears.

Help please?

Lee
Top achievements
Rank 2
Silver
Bronze
Bronze
 answered on 26 Nov 2019
1 answer
167 views

Hi,

Is it possibly to configure a particular toolbar item which always stays visible? For example, I want the "Log out" button to be visible at all times on the right side of the toolbar.

Kind Regards,

Marco

 

 

Petar
Telerik team
 answered on 26 Nov 2019
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?