Using a third-party widget

2 posts, 0 answers
  1. Stephen
    Stephen avatar
    24 posts
    Member since:
    May 2011

    Posted 14 Jan 2012 Link to this post

    I'm trying to use a grid column template to add a third-party widget to the cells of that column. So far, my best idea has been to template the column like so:

    columns: [{
    field: 'SKUId',
    width: 150,
    title: 'SKU',
    template: '<div id="skulookup_#= promotionskuId #" onreadystatechange="PromotionalSKUs.setupSKULookup(this)" />'
        }]

    The PromotionalSKUs.setupSKULookup method creates the widget like so:

    function setupSKULookup(element) {
        if (element.readyState == "complete")
            $(element).lookup({});
    }

    However. This method never gets called. Is there some way for me to call a method to initialize my widget when the template is converted to HTML and added to the DOM?


  2. Rosen
    Admin
    Rosen avatar
    3236 posts

    Posted 16 Jan 2012 Link to this post

    Hello Stephen,

    In order to achieve similar to the described functionality, you may use Grid's dataBound event to find all of the elements over which the new widget should be instantiated. For example:


    All the best,
    Rosen
    the Telerik team
    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
Back to Top