+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom widget designer

Custom widget designer

2 posts, 0 answered
  1. Brian
    Brian avatar
    8 posts
    Registered:
    02 Aug 2014
    24 Sep 2014
    Link to this post
    I'm looking for a tutorial on custom widget designers. I'm currently generating designers via thunder which makes life easy. However, when I choose to use the DynamicContentPicker for a widget Guid property it renders an ugly control. The control allows me to correctly pick the dynamic content item that I wish but after selecting there is no display of the name of the item that has been chosen. Also, when opening the designer for a previously configured widget there is no visual indication which related item has been chosen, only a Guid which is not helpful to normal editor users.
  2. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    08 Dec 2016
    29 Sep 2014
    Link to this post
    Hello Brian,

    Please, take a look at this thread. It shows how you can modify the existing selector to be used to select multiple items and also how you can get the item full info from its guid in refreshUI function. This way you can bind the items to a kendo observable object and show them using a kendo template:
    <ul id="selectedItemsList" runat="server" data-template="ul-template-MyTestsSelector" data-bind="source: items"  class="sfCategoriesList"></ul>
    <script id="ul-template-MyTestsSelector" type="text/x-kendo-template">
        <li>
            <span data-bind="text: Title.Value, attr: {data-id: OriginalContentId}"> </span>
            <a class="remove sfRemoveBtn">Remove</a>
        </li>
    </ul>

    This is for multiple items, though, the way to obtain the information necessary is the same using a service, example (refreshUI):
    var data = {
                    "itemType": this._itemsType,
                    "filter": filterExpression,
                    "provider": this._providerName,
                };
                var self = this;
                $.ajax({
                    url: this._serviceUrl,
                    type: "GET",
                    dataType: "json",
                    data: data,
                    headers: { "SF_UI_CULTURE": "en" },
                    contentType: "application/json; charset=utf-8",
                    /*on success add them to the kendo observable array*/
                    success: function (result) {
                        // successHandler
                    }
                });

    Then you can show the items data instead of the Guid in the same element.


    Regards,
    Nikola Zagorchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered