Telerik Forums
Kendo UI for jQuery Forum
10 answers
1.9K+ views
Is there an easy way to have the numeric text boxes in edit mode in a grid not include the spinners?

I've tried this:
  { width: 30, field: "Price", format: "{0:c}", attributes: { spinners: false } }, 
and this:
  { width: 30, field: "Price", format: "{0:c}", spinners:false }, 

But neither achieves what I want. Do I really need to add code that hides them each time the numeric edit control is activated?
Shawn
Top achievements
Rank 1
 answered on 27 Apr 2016
2 answers
370 views

Hello Kendo team,

I have a AngularJs Grid with scrollable set to { virtual: true } inside a TabStrip tab. This tab is not the selected tab, but the grid loaded in the background tab anyhow. When I switch to the tab containing grid, the scrolling is broken. If I hide (ng-if="false") the grid, and reload it again while I have this grid tab selected, the grid works fine. See plunk for demo of the problem.

Instruction for reproduce:

1. Select "Virtualized locked Grid" tab and try to scroll. Cannot, the scrolling is broken.

2. Without leaving this tab, click on the "Hide / Show Grids" button to remove the grid, and click again to reload the grid. Try scrolling, the scrolling works!

3. Select "Simply Locked Grid" tab and try to scroll. Scrolling works fine.

4. Select "Simply Virtualized Grid" tab and try scroll. Cannot, scrolling is broken like the "Virtualized locked Grid" tab.

5. Try step #2 on the "Simply Virtualized Grid" tab, and the scrolling works again. 

It seems grid with scrollable set to { virtual: true }, with or without locked columns have scrolling problems when loaded inside a tab when the tab is not actively selected.

 

Help! Will you guys fix this as a bug, or do you have any suggestions to combat this problem meanwhile? (I know I can refresh the widget on activation event, but that's hell of annoyance. The whole reason we ditched our self made tab directive was to avoid complicated refresh widget dance on tab selection. )

Best,

Ama

Anna
Top achievements
Rank 1
 answered on 26 Apr 2016
3 answers
1.4K+ views

How do I make the multi select default to the first value if there is only one row in the datasource view when the datasource is filtered

 

In angular i have tried many things, last thing I tried was a watch.   Here is code that is not working where ddlRegion is my angular multiselect

 

    $scope.$watch("dsRegions.view().length",
                 function handledsRegionsChange(newValue, oldValue) {
                     values = [];

                     if (($scope.dsRegions.view().length == 1) && ($scope.selectedRegion == null)) {
                         values[0] = $scope.dsRegions.view()[0].RegionId.toString()
                         $scope.selectedRegion = $scope.dsRegions.view()[0].RegionId;
                         $scope.ddlRegion.value(values);
                     }
                 }
             );

 

 

Boyan Dimitrov
Telerik team
 answered on 26 Apr 2016
2 answers
1.0K+ views

Hi,

 

I am using kendo treeview with checkboxes in ASP .Net MVC. The datasource for the treeview is a list of item and want some of them to be selected on loading the treeview and then I want to pass the newly selected items to the controller. I can achieve each one of the two separately(with a line of code for each functionality), but they seem to be mutually exclusive.

 

This is my code for the view:

@(Html.Kendo().TreeView()
                        .Name("PrescriptionProductInstructions")
                        .DataTextField("Name")
                        .Checkboxes(x => x.CheckChildren(true))
                        .CheckboxTemplate("<input type='checkbox' name='checkedFiles[#= item.id #]' value='#= item.id #' #if(item.IsChecked){# checked #}#/>")
                        .Events(events => events.DataBound("onDataBound"))
                        .Checkboxes(x => x.Name("PrescriptionProductInstructions"))                        
                        .DataSource(source => source.Read(read => read.Action("GetInstructions", "Note", new { productId = Model.ProductId, personId = Model.PersonId }))))

    <script>
         function onDataBound() {
            $("#PrescriptionProductInstructions").data("kendoTreeView").expand(".k-item");
        }
    </script>                         

 

The first bold line of code helps me pre-select some item when loading the tree and the second line of code helps me pass the list of ids of the selected items.

 

My question is whether I can have both functionalities as the same time? If yes, how?

 

Thanks in advance.

 

Regards,

 

Dayana Hadzhipetrova

Dayana
Top achievements
Rank 1
 answered on 26 Apr 2016
1 answer
462 views

Hi,

Does kendo offer the possibility to build a dashboard by defining the queries and the type of charts?

Like the dashboard of devexpress: https://www.devexpress.com/products/net/dashboard/

Thanks,

Seifeddine

Vessy
Telerik team
 answered on 26 Apr 2016
1 answer
104 views

Hi,

With Kendo Scheduler in Day or Week view, moving some all day events causes "Uncaught TypeError: Cannot read property 'startOffset' of null".

Steps to reproduce:

1. Almost any Kendo demo. For example: http://demos.telerik.com/kendo-ui/scheduler/move-resize

2. In week view, move two events to "all day events" for the same day.

3. Refresh the page. With demo this occurs only after refresh as the events must come from API as all day events for the same day.

4. Start dragging the lower all day event..

This causes "Uncaught TypeError: Cannot read property 'startOffset' of null". Reason is that Kendo cannot find a slot for event. This is because the all day slot height is too low to cover more than one event (only reaches the top all day events).

 

BR,

Keijo

Vladimir Iliev
Telerik team
 answered on 26 Apr 2016
1 answer
87 views
Hi,

I was using " Kendo UI v2015.1.318 " and the function fileupload add and remove files , but after update to " Kendo UI v2016.1.112 " , the function only add the files. I did try catch the problem but is as if no event.

Someone can help?
Dimiter Madjarov
Telerik team
 answered on 26 Apr 2016
1 answer
250 views

Hiya,

I was trying to disable a button inside a toolbar using the code below (code snippet from http://demos.telerik.com/kendo-ui/toolbar/api ):

$(".toggleRepeat").click(function() {
    var toolbar = $("#toolbar").data("kendoToolBar"),
        repeatButton = $("#repeat"),
        isDisabled = repeatButton.hasClass("k-state-disabled");
 
    toolbar.enable(repeatButton, isDisabled);
});

After looking at the developer tools and inspecting the said button, I noticed it is not marked as aria-disabled. Is there a way to achieve this?

Kind regards, Byang

Alexander Valchev
Telerik team
 answered on 26 Apr 2016
1 answer
231 views

I need to create a list of menu items server side and then bind to the kendo menu, but I am unable to create items with child items.

View:

@model IEnumerable<MenuItem>
 
@(Html.Kendo().Menu()
          .Name("Menu")
          .BindTo(Model))

I was unable to find a way to make childOne and childTwo children of the parent menuItem and added to the allMenuItems list

The allMenuItems is what I am passing to the View

var parent = new MenuItem() {Text = "Parent"};
var childOne = new MenuItem() { Text = "Child 1", ActionName = "Foo", ControllerName="Bar" };
var childTwo = new MenuItem() { Text = "Child 2", ActionName = "Foo2", ControllerName = "Bar" };
 
var allMenuItems = new List<MenuItem>();

I need some sample code showing how to build this list server side.

Thank you.

Alexander Popov
Telerik team
 answered on 26 Apr 2016
11 answers
1.4K+ views
The attached picture1 is what I want to achieve. In the grid there is a list for students and their favorite fruits. The favorite fruits list only for text, in database they are saved as comma seperated numbers such as 1,2,3, and in the data source schema, there is a column for it named fids. And for the fruits, there is a table in database, and an additional odata source for it.
 In the popup editor, I only want to change their favorites not others, and the popup editor is implemented as checkboxes list, just like attachment picture2. The checkboxes list is initialized in the edit event of the gird. In the grid edit event, I have the following code:


  edit: function (e) {
        $("#fruitLists").css({ 'overflow-y': 'scroll', 'width': '280px', 'height': '170px' });

        var checkboxes = '';
        var fruitArray = e.model.fids.split(",");
        var data = that.fruitDataSource.data();
        for (var i = 0; i < data.length; i++) { //generate checkboxes list
            var checked = fruitArray.indexOf(data[i].id + '') > -1 ? "checked" : "";
            checkboxes += "<input type=\"checkbox\" name=\"fruitIdent\" value=\"" + data[i].id + "\" " + checked + " />" + data[i].name + "<br />\n";
        }
        $("#fruitLists").html(checkboxes);

        e.container.find(".k-button.k-button-icontext.k-primary.k-grid-update").click(function () {
            var checkedItems = [];
            $("input[name='fruitIdent']:checked").each(function () { checkedItems.push($(this).val()); });
            e.model.fids = checkedItems.join();

            //update favorite fruits...

            $("#grid").data("kendoGrid").saveRow();           
        });        
    },

My template for popup editor:
<div class="k-edit-form-container" id="popEditor">
    <script id="popup_editor" type="text/x-kendo-template">
        <div id="fruitLists" style="margin-left:35px">

        </div>
</script>
</div>


And the schema for students list:
    model: {
        id: "id",
        fields: {
            id: { type: "number", nullable: false, editable: false },   //headmap
            name: { type: "string", nullable: true },
            favorits: { type: "string", nullable: true },
            fids: { type: "string", nullable: true },
        },
    },

The curious is that, each time I click the Update button, it always trigger data source - transport's create event, not update event. Why? I searched this forum, many guys says that it is because the schema has no id or the popup UI has no id, but even I added the id field, only create event is fired with a null model. 

Why my approach does not work? Is there any solution? Thansk.


Alexander Valchev
Telerik team
 answered on 26 Apr 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?