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

[Solved] Images Disappear After Initial Dropdown

4 Answers 161 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 14 Sep 2009, 11:31 PM
Folks,

I have seen this issue referenced, but no resolution. Essentially, it is this:

When a StartsWith or Contains Filter is used with the RadComboBox, the images disappear in the dropdown after the first Open. I noticed that if a full postback occurs, the images will eventually show again, but if AJAX is used on the selecteditemchanged event then the images are forever gone until the entire page is reloaded. I have tried to workaround this is numerous ways, even trying to set the text to an initial null state...all to no avail.

What is the workaround for this issue. Under the current situation the image is essentially useless (and invisible) after a single click, regardless of how many times a user may be opening and closing it.

Thoughts? Help!

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 17 Sep 2009, 05:36 PM
Hello Scott,

This is a bug which I logged in our bug-tracking system. I also updated your Telerik points for the report.

Currently you can workaround the bug at your side by putting the following script somewhere after the ScriptManager on your page:

        Sys.Application.add_init(function() { 
            Telerik.Web.UI.RadComboBox.prototype._removeEmTagsFromAllItems = function() { 
                if (this.get_isTemplated() || this.get_filter() == Telerik.Web.UI.RadComboBoxFilter.None) 
                    return
 
                this.get_items().forEach( 
                    function(item) { 
                        var itemText = item.get_text(); 
                        item.set_text(itemText); 
                        item.get_element().innerHTML = 
                            Telerik.Web.UI.RadComboBox.htmlEncode(itemText); 
                        item._createImageElement(); 
                    } 
                ); 
            } 
            var $p = Telerik.Web.UI.RadComboBoxItem.prototype; 
            $p.oMarkText = $p._markText; 
            $p._markText = function(t) { this.oMarkText(t); this._createImageElement(); }; 
        }); 

Please let me know if you experience any other issues related to this workaround.

Regards,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Scott
Top achievements
Rank 1
answered on 18 Sep 2009, 11:38 AM
Simon,

With this solution, the dropdowns are now populated with a "not found" image with 28x30 dimensions (after the initial drop).

I assumed this script as javascript and wrapped it in <script> tags. Am I incorrect?
0
Simon
Telerik team
answered on 23 Sep 2009, 02:54 PM
Hi Scott,

Yes, the script is surrounded in script tags.

As for the images, I forgot to execute the code updating the src attribute of the image element. Please modify the code as indicated below:

<script type="text/javascript"
        Sys.Application.add_init(function() { 
            Telerik.Web.UI.RadComboBox.prototype._removeEmTagsFromAllItems = function() { 
                if (this.get_isTemplated() || this.get_filter() == Telerik.Web.UI.RadComboBoxFilter.None) 
                    return
 
                this.get_items().forEach( 
                    function(item) { 
                        var itemText = item.get_text(); 
                        item.set_text(itemText); 
                        item.get_element().innerHTML = 
                            Telerik.Web.UI.RadComboBox.htmlEncode(itemText); 
                        item._createImageElement(); 
                        item._updateImageSrc(); 
                    } 
                ); 
            } 
            var $p = Telerik.Web.UI.RadComboBoxItem.prototype; 
            $p.oMarkText = $p._markText; 
            $p._markText = function(t) { this.oMarkText(t); this._createImageElement(); this._updateImageSrc() }; 
        }); 
    </script> 
</body> 
</html> 

Please excuse me for my omission.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Simon
Telerik team
answered on 13 Oct 2009, 04:42 PM
Hello Scott,

Please download tomorrow's Internal Build to obtain the fixed version.

After upgrading you could safely remove the previously suggested workaround.

If you continue to experience any related issues please let me know.

Greetings,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Scott
Top achievements
Rank 1
Answers by
Simon
Telerik team
Scott
Top achievements
Rank 1
Share this question
or