Custom widget designer

Posted by Community Admin on 04-Aug-2018 15:50

Custom widget designer

All Replies

Posted by Community Admin on 24-Sep-2014 00:00

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.

Posted by Community Admin on 29-Sep-2014 00:00

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
 

This thread is closed