click event

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    4 posts
    Member since:
    Sep 2012

    Posted 08 Jun 2015 Link to this post

    Hi

    How do I pass a value from the button .content

    @(Html.Kendo().Button()
                    .Name("p14")
                     .HtmlAttributes(new { type = "button" })
                    .Content("135")
                           .Events(ev => ev.Click("onClickPol")))
         <script>
        function onClickPol(e) {
           //This dos not work, I want to retrieve the name, content of that button what n this case is 135
            var xContent  = $(e.event.target).closest(".k-button").attr("textContent")

        }
        </script>

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 09 Jun 2015 Link to this post

    Hello Andrew,

    If you would like to access the text content of the button, you could directly use jQuery.

    this.wrapper.text()

    Regards,
    Dimiter Madjarov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top