PDA

View Full Version : change the ext web desktop background



re7abmk
2 Mar 2010, 4:49 AM
i want to do something like preference in this example
http://www.qwikioffice.com/desktop-demo/
at least to able the user to change the desktop background image from the available images
but really i couldn't understand the code of this example in this point
i don't know exactly from where i should start to understand
I did more searches here for explanation of this point using (extjs,php) but i didn't find anything useful for me

any help?!!!!!?:-?

fay
2 Mar 2010, 5:20 AM
You can try this out in the \examples\desktop\sample.js file:


getStartConfig : function(){
return {
title: 'Jack Slocum',
iconCls: 'user',
toolItems: [{
text:'Settings',
iconCls:'settings',
scope:this,
handler: function()
{
Ext.getBody().setStyle('background-image', 'url(./wallpapers/sky.jpg);');
}
},'-',{
text:'Logout',
iconCls:'logout',
scope:this,
handler: function()
{
Ext.getBody().setStyle('background-image', 'url(./wallpapers/desk.jpg);');
}
}]
};
}

re7abmk
2 Mar 2010, 5:52 AM
it's work but actually i want something else... i want to give the set style url from the selected image....

Ext.getBody().setStyle('background-image', 'url(wallpapers/sky.jpg)')
i want to use something like image chooser
http://www.extjs.com/deploy/dev/examples/view/chooser.html (http://www.extjs.com/deploy/dev/examples/view/chooser.html)
as a simplest way; but it doesn't work also on local ... (no images)!!! i don't know way although it was work without problems!!!!!!!
http://lh6.ggpht.com/_L8alxOnhHTA/S40WsPAE7VI/AAAAAAAAAWg/y-8N1k3XzDg/s640/view%20images.JPG
anyway i want to add this image data view and when the user select the image (if it will display:(() i get the url of this image and send it to setStyle(...)
it's just my idea for this point, am sure there are ideas better than mien
i hope that i explained it well!! :(


really, thank you for your response :)

re7abmk
2 Mar 2010, 11:04 PM
NO IDEA???!!!!!!

re7abmk
3 Mar 2010, 2:22 AM
i got the problem but unfortunately i didn't get the solution ... the problem is that All the exampls use .json can not display the data (display only an empty grid) on all browsers
i use WAMP server ... i don't know why it was display and now nooo... i didn't change any configuration!!!!
any one help me please...

fay
3 Mar 2010, 2:24 AM
NO IDEA???!!!!!!

:) No need to shout, especially since you only posted your original question less than 24 hours ago. For more a *immediate* response try a Support Subscription (http://www.extjs.com/store/extjs/#support-table).

1. If you want to use something like the Image Chooser (on your system/server), it's very easy to change the example code to:


function insertImage(data)
{
Ext.getBody().setStyle('background-image', 'url(' + data.url + ')');
btn.focus();
};

2. If you want the user to be able to select an image from their local system, I'd recommend that you get them to upload the image to your server, and from there you can apply it to the background-image. There are several extensions for uploading files, and many posts in the forums - try searching for "image upload" or "file upload".

re7abmk
3 Mar 2010, 2:49 AM
:) No need to shout, especially since you only posted your original question less than 24 hours ago
i didn't mean to shout :) i am sorry :)



1. If you want to use something like the Image Chooser (on your system/server), it's very easy to change the example code to:


function insertImage(data)
{
Ext.getBody().setStyle('background-image', 'url(' + data.url + ')');
btn.focus();
};i will try to change the example code.... but i don't want uploading at least now:)
all the examples that display images use json so i can't get this point well, that is all

really; thank you for your quick response...