This is a migrated thread and some comments may be shown as answers.

Refresh Snippet list from javascript

1 Answer 67 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jud eMilstan
Top achievements
Rank 1
Jud eMilstan asked on 25 Jun 2014, 01:22 PM
Hi,

I want to refresh the list of snippet from javascript so that i can change snippet list by changing a option.

i have tried this way but list won't get refresh. any possible way to fix this.

    function PopulateSnippets(data) {
        var editor = $("#Body").data("kendoEditor");
        editor.options.insertHtml.length = 0;
        
        var snippetArray = [];
        $(data).each(function (index, item) {
            snippetArray.push({
                text: item.Text,
                value: item.Value
            });
        });
        editor.options.insertHtml = snippetArray;
    }

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 27 Jun 2014, 07:13 AM
Hello Jenny,

You can change the items in the drop-down by getting the instance of the editor SelectBox widget and changing its datasource, like shown in this Dojo snippet.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Editor
Asked by
Jud eMilstan
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or