Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to properly reference this file?
Message
From
29/03/2013 03:54:26
 
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01569507
Message ID:
01569513
Views:
47
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>
>In my Web application I have the following structure:
>
>Content
>      Themes
>           FlexiGrid
>                Images
>                      add.png
>
>
>And I have also
>
> Scripts
> Clients.js
>
>So, I have the following code that defines my grid in the Clients.js file
>
>
>buttons: [
>    { name: 'Add', bclass: 'add', bimage: '~/Images/add.png',  tooltip: 'Add new client', onpress: add },
>    { name: 'Edit', bclass: 'edit', tooltip: 'Edit selected client', onpress: edit },
>    { name: 'Delete', bclass: 'delete', tooltip: 'Delete selected client', onpress: del },
>    { separator: true }
>    ],
>
>This doesn't work. I am wondering how should I correctly reference the add.png for bimage ?
>
>In the flexigrid.js I see the following code:
>
>
>var btn = p.buttons[i];
>				if (!btn.separator) {
>					var btnDiv = document.createElement('div');
>					btnDiv.className = 'fbutton';
>					btnDiv.innerHTML = ("<div><span>") + (btn.hidename ? " " : btn.name) + ("</span></div>");
>					if (btn.bclass) $('span', btnDiv).addClass(btn.bclass).css({
>						paddingLeft: 20
>					});
>					if (btn.bimage) // if bimage defined, use its string as an image url for this buttons style (RS)
>						$('span',btnDiv).css( 'background', 'url('+btn.bimage+') no-repeat center left' );
>						$('span',btnDiv).css( 'paddingLeft', 20 );
>
>					if (btn.tooltip) // add title if exists (RS)
>						$('span',btnDiv)[0].title = btn.tooltip;
>
>					btnDiv.onpress = btn.onpress;
>					btnDiv.name = btn.name;
>
>
>Thanks a lot in advance.

Isn't the use of a tilde an ASP.NET only thing? In Javascript on the client you need to provide the path as an absolute or relative URI
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform