문제

HI,

I am having one check box and one table and table has 10 rows .If user selects the check box then all the 10 rows in the vaadin table should need to select but i don't know how to achieve this functionality.Can anyone tell me how to achieve this? If possible provide me some code snippet.

도움이 되었습니까?

해결책

OOTB 로고는 180px x 64px이므로 이미지를 최상의 방법으로 표시 할 비율이 있어야합니다 (OOTB 로고처럼).

이미지를 ootb 이미지와 동일한 비율로 자르면됩니다.

렌더링을 수정하여 적어도 .ms-siteicon-img CSS 클래스 를 무시 해야하는 로고 형식을 덮어야합니다.

오늘이 클래스는 를 적용합니다.

display:block;
max-height: 64px;
max-width: 180px;
.

이미지의 원인이 당신이 wnat 로 렌더링되지 않는 것입니다.

다른 팁

Make sure the table has yourTable.setMultiSelect(true) and then just iterate the ID's got from yourTable.getItemIds() and call yourTable.select(id) for all id's. This is one way.

In Vaadin 7 when you have table with container data source you can do this:

table.setValue(container.getItemIds());

In Vaadin 6 works this for me:

public void selectAll() {
    int size = table.getItemIds().size();
    for(int i = 0; i < size; i++) {
        table.select(i);
    }
    table.requestRepaint();
}

And of course in both Vaadin versions don't forget to these lines:

table.setSelectable(true);
table.setMultiSelect(true);

You can simply do it by

Table table = new Table(); 
table.setValue(table.getItemIds());

It should not cause performance troubles instead you have few hundreds rows. In case you have - bad architecture.

Also you can just iterate through the list (Vaadin does the same) Here you can find how to reverse selected list using simple iteration. In two words:

            Collection<Object> toSelect = new ArrayList<Object>();
            for (Iterator<?> it = simpleTable.getItemIds().iterator(); it.hasNext(); )                 {
                Object next = it.next();
                if (!((Collection<?>) simpleTable.getValue()).contains(next))
                    toSelect.add(next);
            }
            simpleTable.setValue(toSelect);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top