 | PHP Builder free solutions for web developers
|
|
|
COMPUSORY UPGRADE!!! Request an upgrade NOW! 32+ Pre-installed Modifications! 3 Server Locations to choose from: USA, UK and JAPAN.
11th December 2012 - phpBB88: All servers are upgraded to run using SSD drive. Click Here to report problems!
| View previous topic :: View next topic |
| Author |
Message |
zewa666 Site Moderator


Joined: 01 Feb 2007 Posts: 606 :
Items
|
Posted: Thu Dec 20, 2007 10:32 am Post subject: [DG-PLUGIN] Adding CSS ref to XML file |
|
|
Hi folks ...
My client wanted to create a XML file to be created from within Datagrid to be able to send it to his local tax office.
Well but before doing it he wanted to take a brief look at it in the Web, and as normal xml is displayed really ugly I built some CSS support for it.
Here is what I done.
In your Bindpage:
after the definition of $css_class
add following line
| Code: | | $dgrid->xmlcss = "PATH TO YOUR CSS FILE"; |
So I created a css file and added all the fields fix, cause i know them in advance.
In your DATAGRID.CLASS.PHP
at the top where we define the vars
// css style --------
add following one
now search in the exportToXml function for the line
$somecontent = "XXX?xml version='1.0' encoding='UTF-8' ?>";
and add following after it
| Code: | | $somecontent .= "\nXXX?xml-stylesheet type='text/css' href='".$this->xmlcss."' ?>"; |
INSTEAD OF XXX PLEASE INSERT < cause forum cuts the code otherwhise
Thats it ...
I also have inserted some \t and \n s after each attribute created so its more readable when opening the xml raw in txteditor.
Greetings
Zewa |
|
| Back to top |
|
 |
| |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|