ICEfaces
  1. ICEfaces
  2. ICE-8639

ace:dataTable - Add capability to freeze a column and allow the rest of the contents to scroll horizontally

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1, EE-3.0.0.GA_P01
    • Fix Version/s: EE-3.2.0.BETA, EE-3.2.0.GA, 3.3
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All

      Description


      Feature Request: Add the ability to freeze or lock a column in place and allow the rest of the columns to scroll horizontally. For example the left most column would be locked in place and the rest of the columns could be scrolled while the left column remained in place.

        Issue Links

          Activity

          Hide
          Nils Lundquist added a comment - - edited

          Well to start off this mode won't be interoperable with multi row headers or the static-header scrollable mode.

          Show
          Nils Lundquist added a comment - - edited Well to start off this mode won't be interoperable with multi row headers or the static-header scrollable mode.
          Hide
          Ken Fyten added a comment - - edited

          Yes it will.
          (Restricted to icesoft-internal-developers group)

          Show
          Ken Fyten added a comment - - edited Yes it will. (Restricted to icesoft-internal-developers group)
          Hide
          Nils Lundquist added a comment - - edited

          As per discussiona with Ken, static header- and multirow (in particular) support will becoming in future revisions.
          (Restricted to icesoft-internal-developers group)

          Show
          Nils Lundquist added a comment - - edited As per discussiona with Ken, static header- and multirow (in particular) support will becoming in future revisions. (Restricted to icesoft-internal-developers group)
          Hide
          Ken Fyten added a comment -

          Nils Lundquist commented on ICE-8639:
          -------------------------------------

          Revision #32283
          Committed by nils.lundquist
          Nov. 21st
          ICE-8639 - ace:dataTable column pinning beta version

          Show
          Ken Fyten added a comment - Nils Lundquist commented on ICE-8639 : ------------------------------------- Revision #32283 Committed by nils.lundquist Nov. 21st ICE-8639 - ace:dataTable column pinning beta version
          Hide
          Nils Lundquist added a comment -

          Initial revision of feature complete pending client feedback. A new JIRA has been opened for known border-driven misalignments.

          Show
          Nils Lundquist added a comment - Initial revision of feature complete pending client feedback. A new JIRA has been opened for known border-driven misalignments.
          Hide
          Russell Lewandowski added a comment -

          SVN 32311, ICE-8639 made a change to the compare that accidentally compared the itemVal to the filterEvent and not the filterVal. Small typo. Attached is the correct code to make this functionality work again. Functionality works in ICEfaces 3.2, only effects 3.3.SNAPSHOT.

          org.icefaces.ace.component.datatable.DataTableHeadRenderer.java
              private static void encodeFilter(FacesContext context, DataTableRenderingContext tableContext, Column column) throws IOException {
                  Map<String,String> params = context.getExternalContext().getRequestParameterMap();
                  ResponseWriter writer = context.getResponseWriter();
                  DataTable table = tableContext.getTable();
          
                  String widgetVar = CoreRenderer.resolveWidgetVar(table);
                  String filterId = column.getClientId(context) + "_filter";
                  String filterFunction = widgetVar + ".filter(event)";
                  String filterStyleClass = column.getFilterStyleClass();
                  String filterEvent = table.getFilterEvent();
                  filterStyleClass = filterStyleClass == null
                          ? DataTableConstants.COLUMN_FILTER_CLASS
                          : DataTableConstants.COLUMN_FILTER_CLASS + " " + filterStyleClass;
          
                  if (column.getValueExpression("filterOptions") == null) {
                      String filterValue = column.getFilterValue() != null ? column.getFilterValue() : "";
          
                      writer.startElement(HTML.INPUT_ELEM, null);
                      writer.writeAttribute(HTML.ID_ATTR, filterId, null);
                      writer.writeAttribute(HTML.NAME_ATTR, filterId, null);
                      writer.writeAttribute(HTML.TABINDEX_ATTR, tableContext.getTabIndex(), null);
                      writer.writeAttribute(HTML.CLASS_ATTR, filterStyleClass, null);
                      writer.writeAttribute("size", "1", null); // Webkit requires none zero/null size value to use CSS width correctly.
                      writer.writeAttribute("value", filterValue , null);
          
                      if (filterEvent.equals("keyup") || filterEvent.equals("blur"))
                          writer.writeAttribute("on"+filterEvent, filterFunction , null);
          
                      if (column.getFilterStyle() != null)
                          writer.writeAttribute(HTML.STYLE_ELEM, column.getFilterStyle(), null);
          
                      writer.endElement(HTML.INPUT_ELEM);
                  }
                  else {
                      writer.startElement("select", null);
                      writer.writeAttribute(HTML.ID_ATTR, filterId, null);
                      writer.writeAttribute(HTML.NAME_ATTR, filterId, null);
                      writer.writeAttribute(HTML.TABINDEX_ATTR, tableContext.getTabIndex(), null);
                      writer.writeAttribute(HTML.CLASS_ATTR, filterStyleClass, null);
                      writer.writeAttribute("onchange", filterFunction, null);
          
                      SelectItem[] itemsArray = (SelectItem[]) getFilterOptions(column);
                      Object filterVal = column.getFilterValue();
          
                      for (SelectItem item : itemsArray) {
                          writer.startElement("option", null);
                          writer.writeAttribute("value", item.getValue(), null);
          
                          Object itemVal = item.getValue();
          
                          if ((filterVal == null && itemVal == null) || itemVal.toString().equals(filterVal)) {  // filterVal was filterEvent
                              writer.writeAttribute("selected", "true", null);
                          }
          
                          writer.write(item.getLabel());
                          writer.endElement("option");
                      }
          
                      writer.endElement("select");
                  }
          
              }
          
          Show
          Russell Lewandowski added a comment - SVN 32311, ICE-8639 made a change to the compare that accidentally compared the itemVal to the filterEvent and not the filterVal. Small typo. Attached is the correct code to make this functionality work again. Functionality works in ICEfaces 3.2, only effects 3.3.SNAPSHOT. org.icefaces.ace.component.datatable.DataTableHeadRenderer.java private static void encodeFilter(FacesContext context, DataTableRenderingContext tableContext, Column column) throws IOException { Map< String , String > params = context.getExternalContext().getRequestParameterMap(); ResponseWriter writer = context.getResponseWriter(); DataTable table = tableContext.getTable(); String widgetVar = CoreRenderer.resolveWidgetVar(table); String filterId = column.getClientId(context) + "_filter" ; String filterFunction = widgetVar + ".filter(event)" ; String filterStyleClass = column.getFilterStyleClass(); String filterEvent = table.getFilterEvent(); filterStyleClass = filterStyleClass == null ? DataTableConstants.COLUMN_FILTER_CLASS : DataTableConstants.COLUMN_FILTER_CLASS + " " + filterStyleClass; if (column.getValueExpression( "filterOptions" ) == null ) { String filterValue = column.getFilterValue() != null ? column.getFilterValue() : ""; writer.startElement(HTML.INPUT_ELEM, null ); writer.writeAttribute(HTML.ID_ATTR, filterId, null ); writer.writeAttribute(HTML.NAME_ATTR, filterId, null ); writer.writeAttribute(HTML.TABINDEX_ATTR, tableContext.getTabIndex(), null ); writer.writeAttribute(HTML.CLASS_ATTR, filterStyleClass, null ); writer.writeAttribute( "size" , "1" , null ); // Webkit requires none zero/ null size value to use CSS width correctly. writer.writeAttribute( "value" , filterValue , null ); if (filterEvent.equals( "keyup" ) || filterEvent.equals( "blur" )) writer.writeAttribute( "on" +filterEvent, filterFunction , null ); if (column.getFilterStyle() != null ) writer.writeAttribute(HTML.STYLE_ELEM, column.getFilterStyle(), null ); writer.endElement(HTML.INPUT_ELEM); } else { writer.startElement( "select" , null ); writer.writeAttribute(HTML.ID_ATTR, filterId, null ); writer.writeAttribute(HTML.NAME_ATTR, filterId, null ); writer.writeAttribute(HTML.TABINDEX_ATTR, tableContext.getTabIndex(), null ); writer.writeAttribute(HTML.CLASS_ATTR, filterStyleClass, null ); writer.writeAttribute( "onchange" , filterFunction, null ); SelectItem[] itemsArray = (SelectItem[]) getFilterOptions(column); Object filterVal = column.getFilterValue(); for (SelectItem item : itemsArray) { writer.startElement( "option" , null ); writer.writeAttribute( "value" , item.getValue(), null ); Object itemVal = item.getValue(); if ((filterVal == null && itemVal == null ) || itemVal.toString().equals(filterVal)) { // filterVal was filterEvent writer.writeAttribute( "selected" , " true " , null ); } writer.write(item.getLabel()); writer.endElement( "option" ); } writer.endElement( "select" ); } }
          Hide
          Nils Lundquist added a comment -

          Thanks for catching this, there must be a hole in our tests for this to have slipped through.

          Show
          Nils Lundquist added a comment - Thanks for catching this, there must be a hole in our tests for this to have slipped through.

            People

            • Assignee:
              Nils Lundquist
              Reporter:
              Arran Mccullough
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: