Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGridField as Dropdown TreeGrid

    Hi,

    We have ListGrid with 2 columns. kcp_name column has OptionDataSource.
    Code:
    ListGridField full_cod = new ListGridField("full_cod");	
    full_cod.setWidth(200);		
    ListGridField kcp_name = new ListGridField("fullname");
    kcp_name.setOptionDataSource(DataSource.get("biViewObjTableDS"));
    kcp_name.setOptionOperationId("fetchKCP");
    kcp_name.setWidth(400);
    When user click add button, it startEditing a new row, then kcp_name field fetches data from OptionDataSource. Now question: How to get derived data as treegrid not as listGrid? So it shows treegrid in listGridField.
    Code:
    ListGrid kcpList = new ListGrid();
    kcpList.startEditingNew();
    Code:
    <DataSource ID="biViewObjTableDS" serverType="sql" tableName="BI_view_obj" >
        <fields>            	   
        	<field name="ID" type="sequence" length="2000" hidden="true" primaryKey="true" />    
        	<field name="par_id" type="integer" hidden="true" foreignKey="BI_view_obj.ID" rootValue="0" />   
        	<field name="full_cod" type="text" length="20" title="Code" />          
            <field name="fullname" type="text" title="Name" />                                                       
        </fields>
        <operationBindings>
        	<operationBinding operationType="fetch" operationId="fetchKCP" >
        		<whereClause> BI_view_obj.typ_name = 'KCP' </whereClause>    			    			
        	</operationBinding>
    	</operationBindings>               
    </DataSource>

    #2
    It sounds like you're trying to have the editor (FormItem) which shows up when you edit a row of a ListGrid, pick up its data from an optionDataSource, and display it as a hierarchy (Tree), not as a flat list. Is that correct?
    If so you should be able to specify the ListGridField editor to be a PickTreeItem in order to get this behavior.

    Regards
    Isomorphic Software

    Comment


      #3
      Yes, you're right!
      I did like this:
      Code:
      PickTreeItem kcp_nameItem = new PickTreeItem("fullname");
      kcp_nameItem.setOptionDataSource(DataSource.get("biViewObjTableDS"));
      kcp_nameItem.setOptionOperationId("fetchKCP");
      kcp_nameItem.setLoadDataOnDemand(false);
      
      ListGridField kcp_name = new ListGridField("fullname");
      kcp_name.setWidth(400);		
      kcp_name.setEditorType(kcp_nameItem);
      but it doesn't fetch data from DataSource. What I did wrong?

      Comment


        #4
        ServerLog.txt in attachment
        Attached Files

        Comment


          #5
          Your DataSource does not appear to have settings which would allow the Records to be arranged into a Tree. See the Tree Databinding overview.

          Comment

          Working...
          X