Column value of child object

  1. #1

    Column value of child object

    I have the following models:

    	<ext:Model runat="server" Name="Lot" IDProperty="Id">
    		<Fields>
    			<ext:ModelField Name="Id" />
    		</Fields>
    	</ext:Model>
    
    	<ext:Model runat="server" Name="Step" IDProperty="Id">
    		<Fields>
    			<ext:ModelField Name="Id" />
    			<ext:ModelField Name="Name" />
    			<ext:ModelField Name="Lot" Type="Object" ModelName="Lot" />
    		</Fields>
    	</ext:Model>
    I want to display the data from the child object (I've confirmed it is loaded) along-side the parent information. The only example I could find covering anything remotely like this was: https://examples5.ext.net/#/Form/Mis.../Data_Binding/ which has `DataIndex="Phone.Home"`, but doing the same here doesn't work:

    					<Columns>
    						<ext:Column runat="server" Text="Name" DataIndex="Name" />
    						<ext:Column runat="server" Text="Lot" DataIndex="Lot.Id" />
    					</Columns>
    I tried several variations, including things like:

    						<ext:ComponentColumn runat="server" Editor="true" Text="Lot" Sortable="false" DataIndex="Lot.Id">
    							<Component>
    								<ext:NumberField runat="server" MinValue="0" DataIndex="Id" />
    							</Component>
    						</ext:ComponentColumn>
    With every combination of `DataIndex` in the `ComponentColumn` and `NumberField` tags that I could think of (none, `Lot`, `Id`, and `Lot.Id`).

    How do you show nested data in a `GridPanel` column?
  2. #2
    Hello @Ytterate!

    Flattening the data to as single object with no children, server side, usually makes it much easier to handle the data at client side. But this examples depicts the scenario I believe you have at hand:

    - Grid Panel > Data Presentation > Data Prepare

    Bear in mind you can clone the whole Examples Explorer project at your site and build, search, change and experiment -- and build test case off examples. This may help you figure out a lot of issues you may encounter and get some nice ideas on approaches you could take in different scenarios.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: Dec 10, 2014, 9:36 AM
  2. Replies: 0
    Last Post: Feb 17, 2014, 5:19 AM
  3. [CLOSED] Client side Column object properties are unreliable
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 20
    Last Post: Apr 22, 2013, 4:11 AM
  4. [CLOSED] Child Grid Column Width Issue
    By amitpareek in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Oct 02, 2012, 5:03 PM
  5. Replies: 0
    Last Post: Mar 25, 2010, 5:41 PM

Posting Permissions