Announcement

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

    SelectItem - How to Not show header on table.

    Hey guys,,

    smart gwt 6.0p.

    I have a pretty good example of your multipleSelect SelectItem running. It's pretty simple and just lists the days of the week. I'm trying to not show the header in the table. (See screenshot).
    I have set
    pickListProperties.setGridComponents(toolStrip, ListGridComponent.BODY); , leaving out ListGridComponent.HEADER , but this results in no table shown at all.

    Is this a bug, or there another way to not show the header? We really don't need the headers with all their features (sorting, etc) and visual heaviness.

    Thanks!

    My code below:

    SelectItem multipleSelect = new SelectItem("multipleSelect");
    multipleSelect.setTitle("Days");
    multipleSelect.setDisplayField("SKU");
    multipleSelect.setValueField("SKU");
    multipleSelect.setPickListWidth(300);

    ListGridField skuField = new ListGridField("SKU", "SKU");
    ListGridField itemNameField = new ListGridField("itemName","Item Name");
    multipleSelect.setPickListFields(skuField, itemNameField);
    multipleSelect.setMultiple(true);

    multipleSelect.setOptionDataSource( daysDataSource("supplyItemDS") );
    ToolStrip toolStrip = new ToolStrip();
    toolStrip.setHeight(30);
    toolStrip.setWidth100();

    ToolStripButton checkAllButton = new ToolStripButton();
    checkAllButton.setWidth("50%");
    checkAllButton.setTitle("Check All");
    checkAllButton.setIcon("[SKIN]/actions/approve.png");

    checkAllButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
    @Override
    public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
    SelectItem selectItem = (SelectItem) form.getField("multipleSelect");
    ListGridRecord records[] = selectItem.getClientPickListData();
    String[] values = new String[records.length];
    for (int i = 0; i < records.length; i++) {
    //values[i] = records[i].getAttributeAsString("itemID");
    values[i] = records[i].getAttributeAsString("SKU");
    }
    selectItem.setValues(values);
    PickListMenu pickList = (PickListMenu) selectItem.getCanvasAutoChild("pickList");
    pickList.hide();
    }
    });

    ToolStripButton checkNoneButton = new ToolStripButton();
    checkNoneButton.setWidth("50%");
    checkNoneButton.setTitle("Uncheck All");
    checkNoneButton.setIcon("[SKIN]/actions/close.png");
    checkNoneButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
    @Override
    public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
    SelectItem selectItem = (SelectItem) form.getField("multipleSelect");
    selectItem.setValues(new String[0]);
    PickListMenu pickList = (PickListMenu) selectItem.getCanvasAutoChild("pickList");
    pickList.hide();
    }
    });
    toolStrip.addMember(checkAllButton);
    toolStrip.addMember(checkNoneButton);

    ListGrid pickListProperties = new ListGrid();
    //pickListProperties.setGridComponents(toolStrip, ListGridComponent.HEADER, ListGridComponent.BODY);

    // DO NOT WANT HEADER
    pickListProperties.setGridComponents(toolStrip, ListGridComponent.BODY);
    multipleSelect.setPickListProperties(pickListProperties);

    return multipleSelect;



    pickListProperties.setGridComponents(toolStrip, ListGridComponent.HEADER, ListGridComponent.BODY);
    Attached Files

    #2
    setShowHeader(false)

    Comment


      #3
      @thomlep,

      did you already try setHeaderHeight(0)?

      Best regards
      Blama

      Comment


        #4
        setShowHeader(false) works. Kind of obvious. :-\ . Thanks!

        Comment

        Working...
        X