Skip to main content

how do i add a custom background into K2 runtime?

the custom background currently is a Red Cross, how do i change this to be something i want

HI,

are you talking about customizing the theme or form color ? I do no see any image customization, either on form or view.


have managed to resolve my question

it was a case of modifying the view in the form and adding a new picture in to replace the existing ones


hi,

 

so actually you wanted to change the picture, not the background.

 

If you want to change a background of a particular view you need to use a script and assign it to a Label/Datalable with Literal option enabled on your form.

 

Use this to change the background color of a view:

<script type="text/javascript">$(document).ready(function() {$('#8f4f202d-ee6e-58e2-f3ec-311d260329c3_c03c682d-8588-d973-fbef-5dd209a91664_Table').css('background','#005AAB');})</script>

(Note, you need to replace 8f4f202d-ee6e-58e2-f3ec-311d260329c3_c03c682d-8588-d973-fbef-5dd209a91664_Table with your view ID - see page source for that)

 

or use this to have an image as a background:

<script type="text/javascript">$(document).ready(function() {$('#f9e62d25-4288-f264-6be6-3d69e1bd6369_615e1caf-f149-ae50-7c75-012f76f4e086_Table').css('background-image','url(bird.png)');})</script>


Is this Id #8f4f202d-ee6e-58e2-f3ec-311d260329c3_c03c682d-8588-d973-fbef-5dd209a91664_Table permanent? Will it not change on machine to machine or browser to browser? If Not then this solution is not permanent. So suggest any permanent solution.


Reply