Custom widget designer
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.
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
>
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
);