Telerik Forums
Kendo UI for jQuery Forum
7 answers
889 views
I am trying to bind my kendo treeview to a sql self referencing table that stores the data needed to represent a multi-level hierarchy of treeview items. I am attaching a picture of my sql table as well as a screen shot of how my treeview is currently displaying this data, and certain items are being duplicated, and I can't determine why. Below is the code for my controller and view.  Pretty sure my table structure is correct, but I'm thinking the query is adding the children nodes a 2nd time but as parent items, so maybe the controller needs to filter out the items that don't have null as the parent ID as it's binding the parent nodes... If anyone can help I'd be very grateful!!!

Controller
    public class NavigationMenuItemController : Controller
    {
        private symphonyappEntities db = new symphonyappEntities();

        // GET: /NavigationMenuItem/
        public ActionResult Index()
        {
            var navigationmenuitems = db.NavigationMenuItems.Include(n => n.NavigationMenuItem1).Include(n => n.NavigationMenu);
            return PartialView("~/Views/Shared/_NavigationBarPartial.cshtml", navigationmenuitems);
        }

        [ChildActionOnly]
        public ActionResult NavBarPartial()
        {
            var navigationmenuitems =
                db.NavigationMenuItems.Include(n => n.NavigationMenuItem1).Include(n => n.NavigationMenu);
            return PartialView("~/Views/Shared/_NavigationBarPartial.cshtml", navigationmenuitems);
        }
}

View
        @(Html.Kendo().TreeView()
                  .Name("treeview")
                  .HtmlAttributes(new { style = "width:200px;" })
                  .Events(events => events
                .Select("onSelect"))
            .BindTo(Model, mappings =>
                  {
                mappings.For<NavigationMenuItem>(binding => binding
                    .ItemDataBound((item, menuItem) =>
                          {
                        item.Text = menuItem.MenuItemText;
                        item.Id = menuItem.MenuItemURL;
                    })

                    .Children(menuItem => menuItem.NavigationMenuItems1));

            mappings.For<NavigationMenuItem>(binding => binding
                    .ItemDataBound((item, submenuitem) =>
                                  {
                        item.Text = submenuitem.MenuItemText;
                        item.Id = submenuitem.MenuItemURL;
                    }));

                  })
        
        )


Dimiter Topalov
Telerik team
 answered on 10 Sep 2016
1 answer
421 views

I am using the HTML wrapper for the ListView in MVC.  I give the ListView a datasource to an Odata service.  I am using a template to display the items in the ListView.  When the page first loads and service returns the data the templates are rendered on the bind.   However, when I attempt to query the data source the template is not rendered.  The call to my OData service succeeds and data is returned as confirmed in the Developer Tools, and loading spinner is displayed over the control while the query is executing.

The idea here is that I will call the query on a button click so that I can apply filters.  

Thanks

 

Template:

<script type="text/x-kendo-tmpl" id="resultsViewTemplate">
    <div class="col-md-6">
        <div class="thumbnail">
            <h2>
                #:Name#
            </h2>
            <div class="result-item location">
                <h3>Location:</h3>
                <p>#:Floor#</p>
                <p>#:StreetAddress#</p>
                <p>#:City#, #:State# #:ZipCode#</p>
            </div>
            <div class="result-item restrictions">
                <h3>Restrictions:</h3>
                <p></p>
                <p></p>
            </div>
            <div class="result-item amenities">
                <h3>Amenities</h3>
            </div>
        </div>
    </div>
</script>

 

Query:

$("#update").on("click", function(e) {
    $("#resultsListView").data().kendoListView.dataSource.query();
});

 

Configuration of the ListView:

@(Html.Kendo().ListView<ResourceViewModel>()
    .TagName("div")
    .ClientTemplateId("resultsViewTemplate")
    .AutoBind(true)
    .DataSource( ds => ds
        .Custom()
        .Type("odata-v4")
        .Transport( tp => tp
            .Read( read => read
                .Url($"/api/vm/Resources/Models.GetAvailable")
            )
        )
        .PageSize(6)
        .ServerPaging(true)
        .ServerSorting(true)
    )
    .Name("resultsListView")
)

 

 

Dimiter Topalov
Telerik team
 answered on 10 Sep 2016
4 answers
803 views

Hi,

the click event is not fired if the button is togleable:

<body>
        <div id="example">
            <div class="demo-section k-content wide">
                <div id="toolbar"></div>
            </div>
            <script>               
                $(document).ready(function() {
                    $("#toolbar").kendoToolBar({
                        items: [
                            { type: "button", text: "Button",click: onclick  },
                            { type: "button", text: "Toggle Button", togglable: true, click: onclick  },
                          ]});
                });
               
              function onclick(e) {
                alert(e.target.context.innerText);
              }
            </script>
        </div>
</body>
Dojo

Is there an other event to catch the state changed?

Peter

Ianko
Telerik team
 answered on 10 Sep 2016
4 answers
290 views
Hi,
Is it available an offline copy of the documentation found here: http://docs.telerik.com/kendo-ui/introduction

Thank you & regards
Bilal 
Rumen
Telerik team
 answered on 09 Sep 2016
2 answers
2.2K+ views

Hi,

I have code similar to this:

http://dojo.telerik.com/OfiMU/7

I want to bind the dropdownlist to a nullable field on the model.  The user should be able to select a value from the list or the select the first optionLabel in order to put the value back to null.  So I added the k-option-label with a value field of null, however when selecting this value in the drop down the model is set to the empty string.  This is a problem as when saved to the database it causes a foreign key exception.   How do I set up the dropDownList to allow it to bind to nullable properties on the model?

 

Thanks

Scott Waye
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 09 Sep 2016
7 answers
120 views

I am looking to see if there is any type of widget similar to the attachment, I know that DevExpress has this type of control and I believe Telerik Ajax for WebForms. I have found a similar control but it strictly a jquery plugin and I have also found an implementation somewhere on this forum posted from back in 2013, but the fiddle was rather confusing and not entirely what I was looking for.

So is there a control like this, or has anyone had to build something similar to this?

Rumen
Telerik team
 answered on 09 Sep 2016
5 answers
355 views
I see there is a pan event that "fires when the user pans the diagram". However, I can't figure out how to pan the diagram. I tried click on an area without selecting an object then drag, but that's not it.

Can you explain how a user pans the diagram?
Daniel
Telerik team
 answered on 09 Sep 2016
1 answer
215 views
When the user navigates in the Grid using the TAB, and when there is a hidden column in the middle, he will have to enter 2 TABs in order to go to the next column. It is like the grid is still considering the column as visual. It should not.
Dimiter Topalov
Telerik team
 answered on 09 Sep 2016
3 answers
386 views

I am using KendoUi tree list with AngularJs. I have large amount of data (~3000 +) which is being updated after each 4 seconds. I have observed that whenever records are updated, it freeze the screen. Is there any solution?

 

Here is dojo link.Steps to run the test app:

1: Click on Add Data button

2:Turn on "Auto update". It will update records after 4 seconds. Now observe the behavior.

 

Update code is as follow:

var record = $scope.gridDataSource.data()[100];
record.Title = "Updated";
$scope.gridDataSource.pushUpdate(record);

Thank you.

 

Dimiter Topalov
Telerik team
 answered on 09 Sep 2016
1 answer
336 views

Hello KendoUI Team,

 

My team is currently exploring using Kendo's Spreadsheet capabilities in one of our applications.  One issue we've encountered that we were hoping you could shed some light on is the behavior that occurs when copy/pasting disabled cells.

Scenario 1:

    - Set A1 as Disabled.  Copy B1 into A1.  A1 does not change because it is disabled.

Scenario 2:

    - Set A1 as Disabled.  Copy A1 into B1.  B1 is now also disabled with A1's value.

 

Both Scenarios "make sense" from a copy pasting sense, but Scenario 2 is certainly less than ideal for what we are trying to achieve.  Our goal is to have a sheet contain certain read-only "ID" columns that are immutable and users cannot change cells from enabled/disabled states.  However if a User were to copy one of these disabled read-only cells into another enabled cell, that change becomes permanent as the user cannot change the cell back to enabled nor can they undo their action as the cell is now read-only.  Is this currently a bug that will be fixed in the near future or do you have any suggested work-arounds?

The only thing that comes to mind is hard-coding all the columns we want to keep enabled and to enable those ranges again whenever the change event is triggered, but this doesn't feel like an efficient solution once our spreadsheets scale large enough.

 

Best,

Jeff

 

    
    
Alex Hajigeorgieva
Telerik team
 answered on 08 Sep 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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?