Package com.smartgwt.client.widgets.viewer

Examples of com.smartgwt.client.widgets.viewer.DetailViewer


    public Canvas getViewPanel() {

        ListGrid listGrid = new ListGrid() {
            @Override
            protected Canvas getCellHoverComponent(Record record, Integer rowNum, Integer colNum) {
                DetailViewer detailViewer = new DetailViewer();
                detailViewer.setWidth(200);
                detailViewer.setDataSource(ItemSupplyXmlDS.getInstance());
                Criteria criteria = new Criteria();
                criteria.addCriteria("itemID", record.getAttribute("itemID"));
                detailViewer.fetchData(criteria);

                return detailViewer;
            }

        };
View Full Code Here


    private Label editorLabel;
    private ItemListGrid itemListGrid;

    public ItemDetailTabPane(DataSource supplyItemDS, DataSource supplyCategoryDS, ItemListGrid itemListGrid) {
        this.itemListGrid = itemListGrid;
        itemViewer = new DetailViewer();
        itemViewer.setDataSource(supplyItemDS);
        itemViewer.setWidth100();
        itemViewer.setMargin(25);
        itemViewer.setEmptyMessage("Select an item to view its details");
View Full Code Here

        countryGrid.setData(CountryData.getRecords());
        canvas.addChild(countryGrid);


        final DetailViewer detailViewer = new DetailViewer();
        detailViewer.setWidth(500);
        detailViewer.setTop(250);
        detailViewer.setFields(
                new DetailViewerField("countryName", "Country"),
                new DetailViewerField("countryCode", "Code"),
                new DetailViewerField("government", "Government"));

        detailViewer.setEmptyMessage("Click a row in the grid");
        canvas.addChild(detailViewer);

        countryGrid.addRecordClickHandler(new RecordClickHandler() {
            public void onRecordClick(RecordClickEvent event) {
                detailViewer.setData(countryGrid.getSelection());
            }
        });

        countryGrid.addRecordDoubleClickHandler(new RecordDoubleClickHandler() {
            public void onRecordDoubleClick(RecordDoubleClickEvent event) {
View Full Code Here

        printStack.setVisibilityMode(VisibilityMode.MULTIPLE);
        printStack.setWidth(400);
        printStack.setHeight(455);


        final DetailViewer printViewer = new DetailViewer();
        printViewer.setDataSource(countryDS);
        printViewer.setWidth100();
        printViewer.setMargin(15);
        printViewer.setEmptyMessage("Select a country to view its details");

        final ListGrid printGrid = new ListGrid();
        printGrid.setHeight(150);

        printGrid.setDataSource(countryDS);

        ListGridField countryCode = new ListGridField("countryCode", "Code", 50);
        ListGridField countryName = new ListGridField("countryName", "Country");
        ListGridField capital = new ListGridField("capital", "Capital");
        ListGridField continent = new ListGridField("continent", "Continent");
        printGrid.setFields(countryCode, countryName, capital, continent);

        printGrid.addRecordClickHandler(new RecordClickHandler() {
            public void onRecordClick(RecordClickEvent event) {
                printViewer.setData(new Record[]{event.getRecord()});
            }
        });

        SectionStackSection countriesSection = new SectionStackSection("Countries");
        countriesSection.setExpanded(true);
        countriesSection.addItem(printGrid);
        printStack.addSection(countriesSection);

        SectionStackSection detailsSection = new SectionStackSection("Country Details");
        detailsSection.setExpanded(true);
        detailsSection.addItem(printViewer);
        printStack.addSection(detailsSection);


        final VLayout printContainer = new VLayout(10);


        HLayout printButtonLayout = new HLayout(5);

        IButton newButton = new IButton("New");
        newButton.setDisabled(true);
        IButton changeButton = new IButton("Change");
        changeButton.setDisabled(true);
        IButton printPreviewButton = new IButton("Print Preview");
        printPreviewButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                Canvas.showPrintPreview(printContainer);
            }
        });
        printButtonLayout.addMember(newButton);
        printButtonLayout.addMember(changeButton);
        printButtonLayout.addMember(printPreviewButton);

        printContainer.addMember(printStack);
        printContainer.addMember(printButtonLayout);


        // The filter is just to limit the number of records in the ListGrid - we don't want to print them all
        printGrid.filterData(new Criteria("CountryName", "land"), new DSCallback() {
            public void execute(DSResponse response, Object rawData, DSRequest request) {
                printGrid.selectRecord(0);
                printViewer.setData(new Record[]{printGrid.getSelectedRecord()});
            }
        });

        return printContainer;
    }
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.viewer.DetailViewer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.