Problem with Advanced-Data-Grid

Discussion in 'PHP' started by fibi, Mar 7, 2010.

  1. #1
    Hallo,

    I try to build an GenericFrame / Advanced-Data-Grid. The first column is a tree, the next columns are normal grid columns.
    My problem: the data is shown only in the first tree-column. And after each line two additional empty lines are visible.

    Here is my link -> lab.genericframe.com/ixobtod/ixobtoddemo1.html
    The PHP code:
    
    <?php
    ...
    ?>
    <generic>
    	<template>
    		<HBox>
    			...
    			<AdvancedDataGrid id="adg1" cornerRadius="20" width="300" height="300" showRoot="false">
    				<columns>
    					<AdvancedDataGridColumn dataField="@name" headerText="Project name"/>
    					<AdvancedDataGridColumn dataField="x" headerText="X-Value"/>
    					<AdvancedDataGridColumn dataField="y" headerText="Y-Value"/>
    				</columns>
    			</AdvancedDataGrid>
    			<Binding source="templatedata.adg.item" destination="adg1.dataProvider"/>
    			...
    		</HBox>
    	</template>
    	<!-- LOAD DATA -->
    	<templatedata>
    		<adg>
    			<item name="EU">
    				<?php 
    					...load the data into $countries_eu...
    					foreach ($countries_eu as $city){
    						echo " <item name=\"".$city[0]."\" > ";
    						echo " <x x=\"".$city[1]."\" /> ";
    						echo " <y y=\"".$city[2]."\"/> ";
    						echo " </item> ";
    					}	
    				?>			
    			</item>
    			<item name="USA">
    				<?php 
    					foreach ($countries_usa as $city){
    						echo " <item name=\"".$city[0]."\" > ";
    						echo " <x x=\"".$city[1]."\" /> ";
    						echo " <y y=\"".$city[2]."\"/> ";
    						echo " </item> ";
    					}	
    				?>			
    			</item>
    		</adg>
    	</templatedata>
    	<!-- CLEAR SCREEN -->
    	<commands>
    		<removeAll/>
    	</commands>
    </generic>
    
    PHP:
    Thank you for your replays!
     
    fibi, Mar 7, 2010 IP
  2. melongrass

    melongrass Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your problem is your structure of the XML. The AdvancedDataGrid component handels your <x> and <y> tags as leaves. You should use something like this

    foreach ($countries_usa as $city){
    echo " <item name=\"".$city[0]."\" x=\"".$city[1]."\" y=\"".$city[2]."\" > ";
    echo " </item> ";
    }

    without using additional sub elements <x> and <y>.
    Cheers.
     
    melongrass, Mar 7, 2010 IP
  3. zannovski

    zannovski Greenhorn

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    I have not used the AdvancedGrid yet, I use <Tree>, but maybe your problem ist dataField="x". This points to a tag. You can use dataField="@x" to point to a property.
    Also check the documentation ;) help.genericframe.com
     
    zannovski, Mar 7, 2010 IP
  4. fibi

    fibi Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the replays. But I still have my problem. lab.genericframe.com/ixobtod/ixobtoddemo1.html
     
    fibi, Mar 9, 2010 IP
  5. hitesh85

    hitesh85 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I am novice in php...
    Just try to be familiar with this site...
     
    hitesh85, Mar 9, 2010 IP