Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to properly reference this file?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
MVC
Title:
How to properly reference this file?
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01569507
Message ID:
01569507
Views:
36
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.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform