Telerik Forums
Kendo UI for jQuery Forum
1 answer
492 views
Hi

Could you please help me out to retrieve the ID attribute of tree elements on drop event

Basically I need the 'ID' attribute of dropped elements i.e source and target element


<div id="treeview"></div>

<script>
function onDrop(e) {
    // here I need the 'ID' attribute of dropped source and target element
    // alert(this.text(e.dropTarget));
},

$("#treeview").kendoTreeView({
    checkboxes: {
        checkChildren: true
    },
    dataSource: [{id:1,text:"root",expanded: true, spriteCssClass: "folder",checked:"true",items:[{id:27,text:"",expanded: true, spriteCssClass: "folder"},{id:28,text:"test6",expanded: true, spriteCssClass: "folder"},{id:29,text:"2233",expanded: true, spriteCssClass: "folder"},{id:30,text:"rajnew",expanded: true, spriteCssClass: "folder"},{id:31,text:"dgfdgfdgfd",expanded: true, spriteCssClass: "folder"},{id:32,text:"dgfdgfdgfd",expanded: true, spriteCssClass: "folder"},{id:33,text:"dgfdgfdgfd",expanded: true, spriteCssClass: "folder"},{id:34,text:"dgfdgfdgfd",expanded: true, spriteCssClass: "folder"},{id:35,text:"rooot",expanded: true, spriteCssClass: "folder"},{id:36,text:"gururajnew",expanded: true, spriteCssClass: "folder",checked:"true"},{id:37,text:"new star",expanded: true, spriteCssClass: "folder",checked:"true",items:[{id:38,text:"tr4estsfdf",expanded: true, spriteCssClass: "folder",checked:"true"}]},{id:39,text:"test 8",expanded: true, spriteCssClass: "folder",checked:"true"},{id:2,text:"A particular hotel",expanded: true, spriteCssClass: "folder",checked:"true",items:[{id:5,text:"test",expanded: true, spriteCssClass: "folder",checked:"true"}]},{id:3,text:"Another hotel",expanded: true, spriteCssClass: "folder",checked:"true",items:[{id:20,text:"MPT Test",expanded: true, spriteCssClass: "folder"},{id:7,text:"Third down",expanded: true, spriteCssClass: "folder",checked:"true",items:[{id:9,text:"Fourth down a 1",expanded: true, spriteCssClass: "folder",checked:"true",items:[{id:11,text:"Fifth down",expanded: true, spriteCssClass: "folder",checked:"true"}]}]},{id:8,text:"Another third down",expanded: true, spriteCssClass: "folder",checked:"true",items:[{id:10,text:"Fourth down b1",expanded: true, spriteCssClass: "folder",checked:"true"}]}]}]}],

    dragAndDrop: true,
    drop: onDrop
});
</script>

   
Alexander Valchev
Telerik team
 answered on 20 Mar 2014
3 answers
141 views
Something strange is baffling me with regard to the mobile list view. Here is the syntax:

@(Html.Kendo().MobileView()
      .Name("detail")
      .Title("Attendance Monitor")
      .Layout("MobileLayout")
      .Content(obj =>
          Html.Kendo().MobileListView()
                  .Name("ParkListDetail")
                      .TemplateId("detailTemplate").AutoBind(true)
                      .DataSource(dataSource => dataSource.Read(read => read.Action("ReadDetails", "Mobile"))))
  )

The method, 'ReadDetails' is not getting called. However, if I put a regular list view on the page, it loads just fine:

@(Html.Kendo().ListView(Model)
                  .Name("ParkListSummary")
                  .TagName("div")
                      .ClientTemplateId("summaryTemplate").AutoBind(true)
                      .DataSource(dataSource => dataSource
                          .Read("ReadDetails", "Mobile")
                          .Model(model => model.Id(park => park.ParkID))
                      ))


What am I missing? I want to have a certain portion of my application as mobile-friendly, but the mobile widgets are not playing nice. I have been through every demo on the site for the list view, but nothing works for me.

Sean~
Kiril Nikolov
Telerik team
 answered on 20 Mar 2014
3 answers
334 views
Hi,

please find attached a small sample I have prepared.
If you run the html file in firefox and view the developer console (F12).
You will see i am outputting on the drag event. - console.log("Drag", e.sourceNode, "over", e.dropTarget);
this console output is the example i found in the documentation.

So when you run this and you drag the "Sofa" to be above "Furniture" - so that it is not under any other node. the e.dropTarget still seems to be Furniture?
I am trying to prevent a node from being dropped if it is not under any other node. ...
How would I do this?
Dimo
Telerik team
 answered on 20 Mar 2014
4 answers
381 views
Hi,

I have a request to add extra information as additional columns to Agenda view.  Is it possible?  If so, please tell me how.

Thanks!
Vince
Top achievements
Rank 1
 answered on 19 Mar 2014
0 answers
334 views
The Kendo UI Team has identified a problem with the TypeScript definitions in all Kendo UI  Q1 2014 distributions.

We have identified the root cause of the problem and all following releases, including internal builds, will be free of this defect.
Corrected definitions are also available for download as attachments to this post.

Please accept our apologies for the caused inconvenience.
Kendo UI
Top achievements
Rank 1
 asked on 19 Mar 2014
1 answer
587 views
Hi,

I am binding dynamic data to kendo ui grid without defining schema. I have to set the column's title,type,sortable options dynamically. i tried to fetch the columns using 
grid.columns option in databound event. but what are the changes i made in databound event  are not reflecting to the grid.

i am defining the grid as below:

$("#grid").kendoGrid({
            dataSource: {
                transport: {
                    read: {
                        url: urlPath,
                        type: "POST",
                        data: {
                            count: function () { return $('#txt_no').val(); },
                                                       
                        }

                    }
                }

Please give a suggestion in which event i should set the column properties dynamically .

Thanks,
Raj Yennam
Dimo
Telerik team
 answered on 19 Mar 2014
4 answers
425 views
Hi,

How can I change the background color of the scheduler table for "Today"? I'm using the bootstrap theme, so the background color of "Today" is gray-ish. I like it to be the same color as a normal day.

Kind Regards,

Marco
Marco
Top achievements
Rank 1
Iron
 answered on 19 Mar 2014
1 answer
71 views
Hi

I need to be compatible with ie7.
If i change the week displayed in the scheduler i get an error in kendo.web.min.js but only if i'm emulating ie7.
It's a compatibility problem?
Dimo
Telerik team
 answered on 19 Mar 2014
7 answers
189 views
I am beside myself trying to do something that should be simple and is available in other grids I have worked with.  I want to know the "Id" of the item that was used to populate a row in the grid.  I have to provide that value if I want to use the "Selectable" option so where is it hiding?  I need to know that value when the user selects a row.  Here is my definition of the grid.

@(Html.Kendo().Grid((IEnumerable<MyRecordType>)Model)
    .Name("rawdatagrid")
    .Columns(columns =>
    {
        columns.Bound(session => session.Time).Width(100);
        columns.Bound(session => session.Glucose).Width(50);
        columns.Bound(session => session.TestEvent).Width(100);
    })
    .Scrollable()
    .Sortable()
    .Resizable(resize => resize.Columns(true))
    .DataSource(dataSource => dataSource
        .Server()
        .Model(model => model.Id(p => p.Id))) // DataSource "Id" required for "Selectable" 
    .Selectable(selectable => selectable
        .Mode(GridSelectionMode.Single)
        .Type(GridSelectionType.Row))
    .Events(events => events.Change("onEventChange"))
)

Here is my event handler for the "Change" event from the grid.  The selectedText concatenates all of the cell values in a row which is very difficult to extract my "hidden" column value from.  The index value changes if you sort.  I've tried several of the different ways I saw from other threads on this board but they don't work for me.
function onEventChange(arg) {
    //var grid = $("#rawdatagrid").getKendoGrid(); // this is better than the next line
    var grid = $("#rawdatagrid").data("kendoGrid");
 
    var selectedItem = grid.select();
    var selectedText = selectedItem.text();
    var index = selectedItem.index();
 
    debugger;
}

What am I missing?  Where is my "Id" value?  I can't believe a product as great as Kendo UI can't do something basic like this.
Entilzha
Top achievements
Rank 2
 answered on 19 Mar 2014
1 answer
271 views
Hi,

I am using parameterMap function in HierarchicalDataSource. At root level everything works as expected. But when it is called from nested datasource, then "type" parameter is undefined. I need mapping only for "create" request.

My treeview definition with datasource looks like this:

$("#tree").kendoTreeView({
        dragAndDrop: true,
        dataSource: {
            transport: {
                read: {
                    url: '@Url.Action("Read", "TreeView")'
                },
                update: {
                    url: '@Url.Action("Update", "TreeView")',
                    dataType: 'json',
                    type: 'POST'
                },
                create: {
                    url: '@Url.Action("Create", "TreeView")',
                    type: 'POST',
                    contentType: "application/json; charset=utf-8",
                    dataType: 'json'
                },
                parameterMap: function (data, type) {
                    if (type == "create") {
                        return JSON.stringify(data);
                    }
                    return data;
                }
            },
            schema: {
                model: {
                    id: "Id",
                    hasChildren: "HasChildren"
                }
            }
        },
        dataTextField: 'Name',
        drop: onTreeviewDrop,
        drag: onTreeviewDrag
    });

Thanks for any help!

Daniel
Telerik team
 answered on 19 Mar 2014
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
Licensing
ScrollView
Switch
TextArea
BulletChart
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
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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?