Announcement

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

    Listgrid columns not adjusting to column name and column data

    Hello there,

    I am using SmartClient Version: v10.0p_2015-05-08/PowerEdition Deployment (built 2015-05-08) with FF 26.

    I am trying to display all the column name and column data elegantly in the listgrid when the data is fetched the first time. But for some reason the column called Batch is taking a lot of space for its header and the last column which is a IButton is not in its own column cell. I have attached a screenshot of the listgrid. Below is my code

    Code:
     
    boundList.setHeight(420);
    boundList.setWidth100();
    boundList.setCanEdit(false);
    boundList.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
    boundList.setAutoFitData(Autofit.BOTH);
    boundList.setAutoFitFieldWidths(true);
    boundList.setAutoFetchData(true);
    boundList.setDataSource(ds);
    
    addMember(boundList);
    Attached Files

    #2
    Hi zaj,

    see this thread (especially the later posts) for help on your last column problem. I'm pretty sure it is related and can be mitigated with ListGrid.setMinFieldWidth().

    On why the column Batch it is the largest you'll need to show your .ds.xml - but most likely it has the largest length attribute of all columns - see ListGrid.getAutoFitExpandField().

    Best regards
    Blama

    Comment


      #3
      Hi Blama,

      Thanks for your feedbacks.

      I was able to resolve that last column problem by setting ListGrid.setMinFieldWidth().
      But that Batch column is still not resolved even after using the ListGrid.getAutoFitExpandField().

      Below are my DS file and the java code.

      Code:
      <DataSource ID="newOrderDS" serverType="sql" tableName="rde">
      
       	<fields>
      		<field name="id" type="sequence" hidden="true" primaryKey="true" />
      
              
      		<field name="dfid" title="Dosage Form" type="integer" foreignKey="dosformDS.id" joinType="outer" displayField = "dosageformName" required="true">
      		</field>
      		<field name="dosageformName" includeFrom="dosformDS.name" hidden="true" />
      		
      		<field name="idp" title="Product" type="integer" foreignKey="productDS.id" joinType="outer" displayField = "productName" required="true">
      		</field>
      		<field name="productName" includeFrom="productDS.name" hidden="true" />
      		     
      		<field name="upck" title="GTIN A Order Quantity" type="integer" required="true"/>
      		<field name="puck" title="GTIN B Order Quantity" type="integer" required="true"/>
      		
      		<field name="thc" title="Batch Number" type="text" required="true"/>
      		
      		<field name="date1" title="Manufacturing Date" type="date" required="true"/>
      		
      		<field name="date2" title="Expiry Date" type="date" required="true"/>
      		
      		<field name="dip" title="Distributor" type="integer" foreignKey="distributorDS.id" joinType="outer" displayField = "distributorName" required="true">
      		</field>
      		<field name="distributorName" includeFrom="distributorDS.name" hidden="true" />
      		
      		<field name="sden" type="boolean" title="Send"/>
      		
      	</fields>
      </DataSource>
      Code:
      boundList.setHeight(420);
      boundList.setWidth100();
      boundList.setCanEdit(false);
      		boundList.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
      boundList.setAutoFitData(Autofit.BOTH);
      boundList.setAutoFitFieldWidths(true);
      boundList.setDataSource(ds);
      boundList.setMinFieldWidth(65);
      boundList.getAutoFitExpandField();

      Comment


        #4
        Hi Blama,

        I managed to resolve that batch column. This did the trick

        Code:
        boundList.setAutoFitFieldsFillViewport(false);
        Thanks!!

        Comment

        Working...
        X