Announcement

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

    ListGrid.hideField() not working if hiding more than one field

    We recently upgraded to SNAPSHOT_v9.1d_2013-10-25/Enterprise Deployment and now columns are not hiding. If we are trying to hide more than one column with ListGrid.hideField() or ListGrid.hideFields() it is not hiding the columns properly now. Only the first column is hidden and the others are not. Hiding columns was working before upgrading. I'm using IE9. I don't see any visible errors being thrown.

    dataGrid.hideFields("hour2s", "hour2");

    Thanks.

    #2
    We were not able to reproduce this issue on the latest build. Can you provide a simple test case demonstrating this failure?

    Comment


      #3
      The code to hide the fields in in the fetchData callback which is below. I've attached the full class and datasource file to see everything. Also, I am seeing an error now. It is "[ERROR] [com.pci.transactions.Transactions] - 09:32:06.205:TMR0:WARN:ListGrid:isc_ExtendedListGrid_0:hideField(): unable to find field object for field: hour2s. Taking no action. To add this field use the setFields() method."

      Thanks for checking.


      dataGrid.fetchData(criteria, new DSCallback()
      {
      @Override
      public void execute(DSResponse response, Object rawData, DSRequest request)
      {
      if (response.getStatus() == DSResponse.STATUS_SUCCESS && response.getData() != null & response.getData().length > 0)
      {
      Record[] records = response.getData();
      if (records.length > 0)
      {
      boolean shortDay = true;
      boolean longDay = false;

      if (shortDay)
      {
      dataGrid.hideField("hour2");
      }
      if (longDay)
      {
      dataGrid.showField("hour2s");
      }
      else
      {
      dataGrid.hideField("hour2s");
      }
      }
      }
      }
      });
      Attached Files

      Comment


        #4
        Here is another case where hiding columns worked from the datasource sample below but is not any longer. We would pass false to "productN" and the other fields would not be visible. Now it is visible. The full datasource is attached.

        <field name="productN" width="70" hidden="true" canEdit="false" type="boolean"/>

        <field name="NdispatchStatus" align="center" title="Dispatch Status" type="text" width="110" visible="productN">
        <valueMap>
        <value id="F">Fixed</value>
        <value id="E">Market</value>
        <value id="NQ">Not Qualified</value>
        </valueMap>
        </field>
        <field name="NselfScheduleMW" align="center" title="Self-Schedule MW" type="float" width="110" visible="productN"/>
        Attached Files

        Comment


          #5
          Checking for any updates on this.

          Comment


            #6
            We are still unable to reproduce this issue. Are you sure that the fields you see an error for actually exist in the DataSource attached to the Grid?

            The below code runs without any errors, on the latest build.
            Code:
            Criteria criteria = null;
            final ListGrid dataGrid = new ListGrid(DataSource.get("animals"));
            dataGrid.setAutoFetchData(true);
            dataGrid.fetchData(criteria, new DSCallback() {
            	@Override
            	public void execute(DSResponse response, Object rawData, DSRequest request) {
            		if (response.getStatus() == DSResponse.STATUS_SUCCESS && response.getData() != null & response.getData().length > 0) {
            			Record[] records = response.getData();
            			if (records.length > 0) {
            				dataGrid.hideFields("commonName","lifeSpan");
            			}
            		}
            	}
            });
            dataGrid.setWidth(400);
            dataGrid.draw();

            Comment


              #7
              Thanks for getting back to us. Yes, I'm sure the fields are in the datasource, please see the attached file ext_transactions_SPPIM.ds.xml. Also, in some places I'm hiding the fields one at a time, which is necessary for us, with ListGrid.hideField("hour2") and not ListGrid.hideFields("hour2"); This is where I saw the error more consistently. Finally, in my third post dated 18th Nov 2013, 07:47 there is another scenario that used to work but is not any longer.

              Thanks again for your help.

              Comment


                #8
                Any updates on this yet?

                Comment


                  #9
                  I am not able to reproduce the issue with the latest build, with a simplified test case, either with hideField or hideFields. Because your examples are not runnable, they rely on a lot of external code there is no way for me to debug your specific code. Please provide us with a simple test case that reproduces the issue. I'm attaching my latest attempt to reproduce the issue.

                  Your code does make reference to an "ExtendedListGrid", this likely has custom code within it. This could be either the culprit, or at least provide us with a direction on how to reproduce the problem.

                  Code:
                  Criteria criteria = null;
                  final ListGrid dataGrid = new ListGrid(DataSource.get("animals"));
                  dataGrid.setAutoFetchData(true);
                  dataGrid.setCanSelectCells(true);
                  dataGrid.setEditByCell(true);
                  dataGrid.setGenerateClickOnSpace(true);
                  dataGrid.setCanDragSelect(true);
                  dataGrid.setCanSelectAll(true);
                  dataGrid.setUseCopyPasteShortcuts(true);
                  dataGrid.setShowFilterEditor(true);
                  dataGrid.setCanEdit(true);
                  dataGrid.setShowAllColumns(true);
                  dataGrid.setAutoFetchData(false);
                  dataGrid.setAutoSaveEdits(false);
                  dataGrid.setUseAllDataSourceFields(true);
                  dataGrid.fetchData(criteria, new DSCallback() {
                  	@Override
                  	public void execute(DSResponse response, Object rawData, DSRequest request) {
                  		if (response.getStatus() == DSResponse.STATUS_SUCCESS && response.getData() != null & response.getData().length > 0) {
                  			Record[] records = response.getData();
                  			if (records.length > 0) {
                  				dataGrid.hideField("lifeSpan");
                  				dataGrid.hideField("commonName");
                  			}
                  		}
                  	}
                  });
                  dataGrid.setWidth(400);
                  dataGrid.draw();

                  Comment


                    #10
                    Hi, we are on build SNAPSHOT_v9.1d_2013-10-25/Enterprise Deployment and I can still reproduce the issue. I think I narrowed it down to when using frozen columns. If I don't use the frozen attribute it appears to work. That said, it used to work with using the frozen attribute. I've attached a very simple case. The code should be runnable at your end.

                    Thanks for looking into it.
                    Attached Files

                    Comment


                      #11
                      Bumping this issue up.

                      Comment


                        #12
                        Hi, is there any update on this? Thanks.

                        Comment


                          #13
                          We've just made a change which we believe will resolve this issue. Please try the next nightly build (Nov 28 or above) and let us know if you continue to see the problem.

                          Thanks
                          Isomorphic Software

                          Comment


                            #14
                            This appears to have resolved our issue, thanks.

                            Comment

                            Working...
                            X