Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tim Sanders on Mar 02, 2009 08:25
open dhtmlx forum
Change style dhtmlxfolders generic type?

Is it possible to dynamically change the style for the xml_generic type in dhtmlxfolders? Specifically, I want to have two xml-generic types of items that have different height/width attributes. The current style is:

    <style>
.dhx_folders_XML_GENERIC_item_selected, .dhx_folders_XML_GENERIC_item{
width:250px;
height:200px;
float:left;
}
</style>

I want to be able to switch to a different xsl format such as

myFolders.setItemType("xml_generic", "folderdetail.xsl");

But for folderdetails.xsl I need the xml_generic width to be 600px and the height to be 250px. How can I change the xml_generic height and width when I use setItemType?

Thank you.
Answer posted by Alex (support) on Mar 03, 2009 02:12

Hello, 

There is setCSSBaseName method. It allows to define the css class for items. For example:

<style> 
.dhx_folders_XML_GENERIC_item_selected, .dhx_folders_XML_GENERIC_item{ 
width:250px; 
height:200px; 
float:left; 
}

.dhx_folders_XML_GENERIC600_item_selected, .dhx_folders_XML_GENERIC600_item{ 
width:600px; 
height:200px; 
float:left; 

</style>

...

function redrawFolders(css_base){

myFolders.setCSSBaseName(css_base);
myFolders.setItemType("xml_generic", "folderdetail.xsl");

}

redrawFolders("xml_generic");

redrawFolders("xml_generic600");