Kendo Binding XML data to Menu

8 posts, 0 answers
  1. Brandon
    Brandon avatar
    2 posts
    Member since:
    May 2014

    Posted 11 Jun 2014 Link to this post

    I asked a question on stackoverflow about binding a xml data file to a Kendo UI Menu. 

    http://stackoverflow.com/questions/23998479/binding-xml-data-to-kendo-ui-menu-dynamically

    I was wondering if Kendo supports binding to a xml file dynamically. If so, could you also create multiple menus with hierarchy structures?


  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 12 Jun 2014 Link to this post

    Hi Brandon,

    The Kendo UI Menu does not support data binding, so it is not possible to bind an XML service to the menu. You can manually create a data structure that you can pass to the menu, as shown in this example:

    http://demos.telerik.com/kendo-ui/menu/images

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Brandon
    Brandon avatar
    2 posts
    Member since:
    May 2014

    Posted 12 Jun 2014 Link to this post

    Thank you Kiril for the quick response! So, is there an alternative way which will allow me to create a menu dynamically?
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 13 Jun 2014 Link to this post

    Hi Brandon,

    As the menu does not support data binding there is no built-in solution to create such. If you check this demo you can see that the menu is initialized with JavaScript and not pure HTML, so if you parse your XML and create similar structure, then you might achieve something like dynamic menu creation.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Ashok
    Ashok avatar
    2 posts
    Member since:
    Jan 2015

    Posted 22 Jan 2015 in reply to Brandon Link to this post

    yes.... same problem i have.have got solution for that
  7. Hemant
    Hemant avatar
    3 posts
    Member since:
    Apr 2015

    Posted 06 May 2015 in reply to Ashok Link to this post

    Hi Ashok, what is the solution you have used? Please share.
  8. Hemant
    Hemant avatar
    3 posts
    Member since:
    Apr 2015

    Posted 06 May 2015 in reply to Kiril Nikolov Link to this post

    Hi Nikolov

    Can you please post a sample of how you would insert the data from the parsed XML into the dataSource that is inside the kendoMenu structure?

    <script>
    $("#menu-images").kendoMenu({
        dataSource: [

  9. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 08 May 2015 Link to this post

    Hello Hemant,

    An example of using a dataSource in a Kendo UI Menu is available here:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/menu#configuration-dataSource

    Please note that it only supports JavaScript array of object, and not XML.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready