Telerik Forums
Kendo UI for jQuery Forum
0 answers
4 views

Can someone tell me how I can align my last element to the right while the others stay to the left please? i am working with asp.net mvc core 8 

 

  @(Html.Kendo().Menu()
      .Name("Menu")
      .Items(items =>
      {
          items.Add().Text("Mis promociones").Action("Index", "Index", new { area = "" });
          items.Add().Text("Crear promoción").Action("Create", "Index", new { area = "" });
          items.Add().Text("Acerca de").Action("About", "Index", new { q = KitSecurity.EncryptQueryString("FolioName=789") });
          items.Add().Text("Contacto").Action("Contact", "Index", new { q = KitSecurity.EncryptQueryString("FOLIO_ID=456456") });
      items.Add().Text("Nombre de usuario").HtmlAttributes(new { @class = "ultimo-elemento" }).Items(subItems =>
      {
          subItems.Add().Text("Otros tramites").Url("https://localhost:44379");
          subItems.Add().Text("Cerrar Sesión").Action("CerrarSesion", "Index", new { area = "" });
      });

      })
  )
Eduardo
Top achievements
Rank 1
 asked on 08 May 2024
0 answers
76 views

Hello,

i need some help regarding a problem with the context-menu. i am total new with the framework so maybe my question sounds a little stupid. sorry for that. 

When an entry in the context menu is clicked twice (kind of double-click) the app has a problem with the request that is still beeing executed by the first click. 

So how can i disable a context menu-entry inside a click handler. We are using typescript.

The handler starts with 

    private OnMenuItemSelect(event: ContextMenuSelectEvent): boolean {
        const item = $(event.item);
        const menuItemId = this.GetMenuItemIdFrom(item);
        if (menuItemId == null) {
            return true;
        }
        const menuItem = this.GetMenuItemById(menuItemId);
        if (menuItem == null) {
            return true;
        }

 

How can i access the clicked entry and disable it ?

Bernd
Top achievements
Rank 1
 asked on 13 Feb 2023
0 answers
41 views

I have a TreeList and a connected ContextMenu.   The context menu shows correctly the first time only when clicking on a TreeList row.  After that however, no matter where I right-click on the page, the context menu is displayed.


@(Html.Kendo().ContextMenu()
    .Name("orgtreemenu")
    .Target("#OrganizationTreeMaintenance")
    .Orientation(ContextMenuOrientation.Vertical)
    .Filter(".k-grid-content table tbody tr[role='row']")
    .Events(e => e
        .Open("orgContextMenuOpen")
        .Select("orgTreemenuSelect")
    )
    .Items(items =>
    {
        items.Add()
            .Text("Add Organization")
            .HtmlAttributes(new { @id = "addorgaction" })
            .Enabled(true);
        items.Add()
            .Text("Edit Name")
            .HtmlAttributes(new { @id = "editorgnameaction" })
            .Enabled(true);
        items.Add()
            .Text("Delete Organization")
            .HtmlAttributes(new { @id = "deleteorgaction" })
            .Enabled(true);

        items.Add()
            .Text("Move Organization")
            .HtmlAttributes(new { @id = "moveorgaction" })
            .Enabled(false);
    }))
@(Html.Kendo().TreeList<UserStatViewModel>()
    .Name("OrganizationTreeMaintenance")
    .Columns(columns =>
    {
        columns.Add().Field(e => e.OrganizationName).Width(300);
        columns.Add().Field(e => e.OrganizationId).Hidden(true);
        columns.Add().Field(e => e.TotalUserCount).Title("Users");
        columns.Add().Field(e => e.TotalDeviceCount).Title("Devices");
        columns.Add().Field(e => e.LicensedUserCount).Title("Licenses");
    })
    .Sortable()
    .HtmlAttributes(new { style = "height:500px;" })
    .Events(e => e
        .DataBound("onDataBoundLicenseTree"))
    .DataSource(dataSource => dataSource
        .Read(read => read.Action("GetOrgLicenseDetails", "home"))
        .ServerOperation(false)
        .Model(m =>
        {
            m.Id(f => f.OrganizationId);
            m.ParentId(f => f.ParentOrgId).DefaultValue(0);
            //           m.Expanded(true);
            m.Field(f => f.OrganizationName);
            m.Field(f => f.TotalDeviceCount);
            m.Field(f => f.ParentOrgId);
        })
    ))

I have tried modifying the Filter on the context menu to no avail.  Hoping someone can see something obvious.

Thanks and regards,

Eric Katz

Eric
Top achievements
Rank 1
 asked on 23 Sep 2021
0 answers
44 views
I am trying to show a menu bar that runs at the top of the page as a header with a logo on the left. I dont want to show any item inside that menu bar. Does Telerik have something like this?
Sandipan
Top achievements
Rank 1
 asked on 02 Jun 2021
0 answers
33 views
Hi guys, I just wanted to share this code in case anyone need it, because I didn't find nothing similar on the forum.

This example loads a kendo menu dinamically from an aspx page, getting the elements from a server method accessed by ajax

.cs file

 [WebMethod(EnableSession = false)]
        public static string GetToolsAdminProjects()
        {
            List<Project> toolsAdminProjectList = ProjectsHelper.GetToolsAdminProjectList();
            List<ContextMenuItem> result = toolsAdminProjectList.Select(e=> new ContextMenuItem
            {
                text = e.DisplayName,
                url = e.URL
            }).ToList();

            var serializer = new JavaScriptSerializer();
            string json = serializer.Serialize(result);
            return json;
        }

.aspx file 
<script type="text/javascript">

 $.ajax({
                 type: "POST",
                 url: "GridView.aspx/GetToolsAdminProjects",
                 data: "{}",
                 contentType: "application/json",
                 dataType: "json",
                 success: function (result) {
                     var d = jQuery.parseJSON(result.d)
                     var menu = $("#menu").data("kendoMenu");
                     menu.append(d);
                 }
             });

</script>

ITServices
Top achievements
Rank 1
 asked on 10 Oct 2014
0 answers
174 views
I am trying to read a Model class which should be populated with menu data from the database and then trying to bind that data to the Kendo Menu. I have copied the razor syntax given in the kendo docs (C# Version) and tried to convert it into VB.NET but i am getting an error that no bindto method accepts this many arguments and i can't figure what the error is? i have pasted the code as following, could someone please have a look and point me in the right direction (Menu and MenuItem are model classes)?

@Imports test.Models
@ModelType IEnumerable(Of MenuCategory)

@(Html.Kendo().Menu() _
            .Name("TestMenu") _
            .BindTo(Model,
                    Sub(mappings)
                            mappings.For(Of MenuCategory)(
                                Sub(x)
                                        x.ItemDataBound(
                                            Sub(item, menu)
                                                    item.Text = menu.Name
                                            End Sub) _
                                                    .Children(
                                                        Function(menu)
                                                                Return menu.SubItem
                                                        End Function)
                                        mappings.For(Of MenuItem)(
                                        Sub(x)
                                                x.ItemDataBound(
                                                        Sub(item, menuItem)
                                                                item.Text = menuItem.Name
                                                        End Sub)
                                        End Sub
)
                                                                                      
                                End Sub)
                    End Sub)
            )
Vivek
Top achievements
Rank 1
 asked on 07 May 2013
0 answers
26 views
Hi Guys,

I am trying to create a dynamic generated menu using MVC, VB.NET and Razor and i am getting the following error:

Compilation ErrorDescription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: BC30561: 'Html' is ambiguous, imported from the namespaces or types 'System.Web.WebPages, System.Web.Mvc, Kendo.Mvc.UI'.

Source Error:

Line 2: @ModelType IEnumerable(Of MenuCategory)
Line 3:
Line 4: @(Html.Kendo().Menu() _
Line 5: .Name("TestMenu") _
Line 6: .BindTo(Model, Sub(mappings)
Source File: C:\Documents and Settings\vivekba\my documents\visual studio 2010\Projects\test\test\Views\Home\TestMenu.vbhtml    Line: 4 



This is my code in the view

@Imports test.Models
@ModelType IEnumerable(Of MenuCategory)

@(Html.Kendo().Menu() _
            .Name("TestMenu") _
            .BindTo(Model, Sub(mappings)
                                   mappings.For(Of MenuCategory)(Sub(x)
                                                                         x.ItemDataBound(Sub(item, menu)
                                                                                                 item.Text = menu.Name
                                                                                         End Sub)
                                                                                                                                                                            
                                                                 End Sub)
                                   
                           End Sub)
    )
           

Any help will be really appreciated please.

Thanks
Vivek
Top achievements
Rank 1
 asked on 07 May 2013
0 answers
85 views
Hi guys, 
I'm trying to implement a kendo menu with an handler for close event.


here is my code:

var MyNamespace = {
 
    Init: function() {
        var menu = $("#userMenu").kendoMenu({ close: MyNamespace.OnClose }).data("kendoMenu");
        ....
    },
     
    OnClose: function() {
        alert("closed");
    }
}

It's pretty much the same code from the demo but I never get the alert win to shows up...
I tried some alternative like put the handler inside the Init method, or to put the alert directly inside .kendoMenu({...})..
nothing happened..
What am I doing wrong? 
thanks
Fabio



EDIT: ok I figured out..
In the code there was another declaration of the same kendoMenu the probably overwrote the one in which i put the handler.
(I'm doing some maintenance to someone else code...)
Sorry!  
Gaetano
Top achievements
Rank 1
 asked on 18 Feb 2013
0 answers
67 views
Hi,
Can i create a DropDown Menu how KendoUI Menu Products ??

Vitantonio
Top achievements
Rank 1
 asked on 16 Nov 2012
0 answers
61 views
Hello,

is there a way to use the "url" property of a menu item to load an html fragment or a page or a partial page inside a specific div through ajax?

Thank you!
Matteo
Top achievements
Rank 1
 asked on 08 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?