Telerik Forums
UI for ASP.NET MVC Forum
0 answers
138 views

Hello,

I want to implement endless scroll for both master and detail grid. Is that possible? I tried to use detail grid as below but nothing worked.

 

@(Html.Kendo().Grid<AspNetCoreGrid.Models.OrderViewModel>() .Name("grid") .Scrollable(sc => sc.Endless(true))
.Scrollable(s => s.Height("100px"))

)

Nevra
Top achievements
Rank 1
 asked on 03 Jan 2023
0 answers
258 views

Try to use the Drag and Drop to reorder the rows. 
I'm stuck in an error that I'm not figuring out.

The error: Uncaught TypeError: Cannot read property 'insert' of undefined

The line: grid.datasource.insert(newIndex, dataItem );

I'm sure the datasource has data, since the "console.log(dataItem)" returns the object model


var Material = new kendo.data.Model.define({
    id: "NR_position",
    fields: {
        NR_position: { type: "number" },
        CD_Material: { type: "number" },
        NM_Material: { type: "string" }
    }
});

var Controller = {
    dataSource: {        
        ListMat: new kendo.data.DataSource({
            transport: { read: { url: matList, type: "POST" } },
            model: Material,             
            dataType: "json",
            url: "data/person.json"
        })
    },
    init: function () {
        var grid = $("#grdMatOrder").kendoGrid({
            dataSource: Controller.dataSource.ListMat,
            columns: [
                { field: "NR_position", title: "Order" },
                { field: "CD_Material", title: "Code" },
                { field: "NM_Material", title: "Name" }
            ]
        }).data("kendoGrid");

        grid.table.kendoSortable({
            filter: ">tbody >tr",
            hint: function (element) {
                var table = $('<tr colspan=4" class="placeholder></ tr>'), hint;

                table.append(element.clone());
                table.css("opacity", 0.7)                

                return table;
            },

            change: function (e) {
                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"));

                console.log(dataItem)

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


$(document).ready(function () {
    Controller.init();
});

        


        

anna
Top achievements
Rank 1
 asked on 09 Jul 2021
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
DateTimePicker
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?