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

PanelBar Append with Image Atrributes

3 Answers 89 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Carrie
Top achievements
Rank 1
Carrie asked on 08 Oct 2013, 12:36 PM
Hello,

I am trying the following append call but I am not seeing the style attributes added.   The append works and I see the image and text but not the styling. 

Any help is appreciated.

Thanks,
Carrie
panelBar.append(
           [
               {
                   text: "Title",
                   encoded: false,                                
                   content: "Some Text",
                   imageUrl: "myimage.jpg",
                   imageHtmlAttributes: { style: "margin-top:8px;margin-right:8px;" }
               }
           ]
       );

3 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 10 Oct 2013, 07:07 AM
Hi Carrie,

In order to apply additional styling to the appended item you could add custom CSS class to it:

panel.append([{
    text: "Title",
    encoded: false,                               
    content: "Some Text",
    imageUrl: "myimage.jpg",
    cssClass: "myClass"
}]);
</script>
 
<style scoped>
.myClass {
    margin-top:8px !important;
    margin-right:8px !important;                   
}
</style>
Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Carrie
Top achievements
Rank 1
answered on 10 Oct 2013, 10:47 AM
Thanks for the direction however I do not want the styling applied to the entire <li>.    I just want it applied to the image.   Using the imageCssClass also does not work.   I wonder if this is a bug? 

In any case I got it to work by tweaking the styling a bit like so:
<style scoped>
.actionLogImage>span>img  {
    margin-top:8px !important;
    margin-right:8px !important;                 
}
</style>
0
Iliana Dyankova
Telerik team
answered on 14 Oct 2013, 10:43 AM
Hi Carrie,

I am glad to hear everything is working fine now. As for the imageCssClass - I am afraid such a method is not supported, however you could check the spriteCssClass.
 

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
PanelBar
Asked by
Carrie
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Carrie
Top achievements
Rank 1
Share this question
or