Telerik Forums
Kendo UI for jQuery Forum
1 answer
75 views

Hi,

We are attempting to set the default values of new rows in a grid based on some user-specified filters. The desired functionality is that if, for example, the "Year Level" filter is set to "Year 1", when a new row is created it will have its Year Level value automatically set to Year 1 AND will be visible in an edit state in the grid. 

We have read the previous Q&A here, however this solution is not suitable as it makes ALL rows with no "Year Level" value become visible when a new row is created.

As the "edit" event does not seem to fire when creating a new row whilst filters are applied, the implementation we are attempting involves saving those filters when the "Add" button is clicked and then re-applying them after the row has been created. This mostly works, but the new row is inserted as an un-editable dirty record and clicking its "Edit" button does nothing.

The code below is a combination of a couple of different approaches. Any guidance would be greatly appreciated!

let currentEditRow;
let currentModel;

$(".k-grid-add").click(function () {
    var grid = $("#grid").data("kendoGrid");

    // Save the current filters before clearing them
    savedFilters = grid.dataSource.filter();
    grid.dataSource.filter([]); 

    // Add a new row and enter edit mode
    currentEditRow = grid.addRow(); 
    grid.editRow(currentEditRow); // Attempting to force new row into edit mode here does not work
});

$("#grid").kendoGrid({
    dataSource: ds,
    sortable: true,
    toolbar: ["create"],
    columns: [
        {
            field: "Yearlevel",
            sortable: false,
            title: "Year Level",
            editor: cmbEditorYearlevelForHomegroup,
            template: "#=Yearlevel?.Name ?? ''#",
            editable: isEditable
        },
        // Other columns here
        { command: ["edit", "destroy"], title: "Action", width: "180px" }],
    editable: "inline",
    edit: function (e) {
        currentEditRow = $(e.container); // Save reference to the editing row
        currentModel = e.model; // Save the current model

        if (e.model.isNew()) {
            var yearLevelDropdown = $("#yearLevel").data("kendoDropDownList");
            e.model.set("Yearlevel", { // Update the values in the new row based on the selected filters
                Code: yearLevelDropdown.value(),
                Id: 0,
                Name: yearLevelDropdown.text()
            });

            var grid = $("#grid").data("kendoGrid");
            if (savedFilters) {
                grid.dataSource.filter(savedFilters); // Re-apply the filters
            }
            if (currentEditRow && currentModel && currentModel.isNew()) {
                var grid = this;
                setTimeout(function () {
                    grid.editRow(currentEditRow); // Attempting to re-enter edit mode for the new row; this also does not work
                });
            }
        }
    }
});

Martin
Telerik team
 answered on 10 Oct 2024
2 answers
603 views
In kendo chart i have to apply some gradient image for plot area.can any one help ?
David
Top achievements
Rank 1
Iron
 answered on 10 Oct 2024
1 answer
66 views
I want an on-screen numeric keypad _ like a phone dialer _ where the user can press screen buttons _ to enter numbers _ like a hand-held calculator.   I suppose that I could create an array of buttons.  I am surprised that I do not see a widget already built.   What is the best way?  Comments would be appreciated.
Neli
Telerik team
 answered on 09 Oct 2024
1 answer
92 views
The tree view in the file manager control only shows folders and subfolders in the navigation pane.  Is it possible to also show files?
Neli
Telerik team
 answered on 07 Oct 2024
1 answer
95 views

Hello, I have noticed some changes on the structure of the Treeview component after version 2024.1.319 March 18, 2024

Classes like k-group and k-in seem to have been removed completely

For example, in previous version, the structure of a Treeview component would look like this:

<ul class="k-group k-treeview-group">
	<li class="k-treeview-item">
		<div class="k-treeview-top">
		         <span class="k-treeview-leaf k-in">TEST STRING</span>
		</div>
	</li>
</ul>

while now it would look like this:

<ul class="k-treeview-group">
	<li class="k-treeview-item">
		<div class="k-treeview-top">
			<span class="k-treeview-leaf">
				<span class="k-treeview-leaf-text">TEST STRING</span>
			</span>
		</div>
	</li>
</ul>

On release notes, I did not find any particular reference on these classes being removed

So my questions are:

  1. Have they been removed widely?
  2. Are there any other components that may still use these classes?
  3. Is there any form of documentation that contain these changes?

Thank you in advance

Martin
Telerik team
 answered on 04 Oct 2024
1 answer
135 views

Hi, I am using Telerik grid in Razor pages applications. I have main grid and Detail grid.

<script id="orderItemsTemplate" type="text/kendo-tmpl">
    @(
        Html.Kendo().Grid<OrderItemInfo>()
                        .Name("OrderItemsGrid_#=RowId#")  // Unique grid name using rowid
                        .Columns(columns =>
                        {
                            columns.Bound(o => o.ItemDescription).Title("Item Description").Width("20%");                           
                            columns.Bound(o => o.QtyDelivered).Title("Qty Delivered").Width(50).Hidden();
                            columns.Bound(o => o.OrderNo).Title("Order No").Width(90);
                          
                    })
                    .ToolBar(tb => tb.Columns())
                    .AllowCopy(true)
                    .Selectable(s => s.Enabled(true))
                    .Sortable()
                    .Events(events =>
                    {
                        events.DataBound("onOrderItemsGridDataBound");
                    })
                    .Size(ComponentSize.Small)
                    .Resizable(resize => resize.Columns(true))
                    .DataSource(dataSource => dataSource.Custom()
                        .ServerGrouping(false)
                        .ServerPaging(false)
                        .ServerFiltering(false)
                        .ServerAggregates(false)
                        .ServerSorting(false)
                    )
                    .ToClientTemplate()
            )
</script>

Problem:   .ToolBar(tb => tb.Columns()) is not working on Detail grid template. 

Mihaela
Telerik team
 answered on 03 Oct 2024
1 answer
183 views

After selecting a file in kendoUpload two buttons show up: Upload and Clear:

Is it possible to hide those two buttons? I want to do the upload process programmatically.

I already found out that the two buttons are not accessible after initialization of the kendoUpload widget but also not right away after the SELECT event triggers (on selecting a file to be uploaded). I have found a solution waiting some milliseconds in the SELECT event to hide the two buttons:

setTimeout(function() {
$('k-actions').css('display', 'none');
}, 10);

Is there a more proper way to hide those buttons?

I'm working with KendoUI for JQuery, very latest official version.

Regards

 

 

Martin
Telerik team
 answered on 02 Oct 2024
1 answer
78 views

Hi,

I have a requirement to highlight a particular attendee with a red border in the dropdown list. The idea is to indicate that this attendee is not available at that specific date and time when someone opens the appointment pop-up (refer to the attachment). I know color option is there but i want to add red border to particular attendee. there can be situation where red border can be added to more then one attendee. Please help me understand how I can achieve this.

Thanks!

Martin
Telerik team
 answered on 01 Oct 2024
2 answers
279 views

Some users do not see very clearly which is the today in the scheduler and asked if the header could be colored. 

I have found that the cells has the class "k-today" but the header does not have it.

Is there a way to know which of the header cells is the cell for the today?

Morten
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 28 Sep 2024
1 answer
93 views

Hi support team,

 

we need filterable: { mode: "row" }  to have  a filter row.

We also need a DropDownList for a boolean column in the filter as described here:

https://docs.telerik.com/kendo-ui/knowledge-base/grid-boolean-dropdownlist-filter

 

When using this we see an ugly filter row item:

 

I expect to have the DropDownList in the filter row.

 

This worked using following MVC template  syntax in the past


   .Filterable(f => f.Multi(false).Cell(c => c.ShowOperators(false)
   .Template(@<text>
               function(args) {
               args.element.kendoDropDownList({
               autoBind: false,
               dataTextField: "text",
               dataValueField: "value" ,
               dataSource: new kendo.data.DataSource({
               data: [{ text: "Ja" , value: "true" },
               { text: "Nein" , value: "false" }]
               }),
               index: 0,
               optionLabel: {
               text: "Filter" ,
               value: ""
               },
               valuePrimitive: true
               })
               }
            </text>

 

is this a bug?

 

Eyup
Telerik team
 answered on 27 Sep 2024
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?