Package com.smartgwt.client.widgets.grid

Examples of com.smartgwt.client.widgets.grid.ListGrid


            endDateFilter.show();
        }
        // refresh the table manually, calling refresh() doesn't work here because the listgrid has set the
        // autoFetchData flag to true and invalidateCache() doesn't do the fetching as mentioned in the refresh()
        // method.
        final ListGrid listGrid = getListGrid();
        Criteria criteria = getCurrentCriteria();
        listGrid.setCriteria(criteria);
        listGrid.fetchData(criteria);
        listGrid.markForRedraw();
        refreshTableInfo();
    }
View Full Code Here


    @Override
    protected void configureTable() {
        super.configureTable();
        List<ListGridField> fields = getDataSource().getListGridFields();
        ListGrid listGrid = getListGrid();
        listGrid.setFields(fields.toArray(new ListGridField[fields.size()]));
        listGrid.sort(FIELD_NAME, SortDirection.ASCENDING);

        for (ListGridField field : fields) {
            // adding the cell formatter for name field (clickable link)
            if (FIELD_NAME.equals(field.getName())) {
                field.setCellFormatter(new CellFormatter() {
View Full Code Here

        DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();
        if ((null != storedPortlet && null != storedPortlet.getConfiguration())) {

            PropertySimple tablePrefs = storedPortlet.getConfiguration().getSimple(CFG_TABLE_PREFS);
            ListGrid listGrid = getListGrid();
            if (null != tablePrefs && null != listGrid) {
                String state = tablePrefs.getStringValue();
                listGrid.setViewState(state);
            }
        }
    }
View Full Code Here

    @Override
    protected void configureTable() {
        super.configureTable();

        ListGrid listGrid = getListGrid();
        ArrayList<ListGridField> fields = getDataSource().getListGridFields();
        listGrid.setFields(fields.toArray(new ListGridField[fields.size()]));

        setListGridDoubleClickHandler(new DoubleClickHandler() {
            @Override
            public void onDoubleClick(DoubleClickEvent event) {
                ListGrid lg = (ListGrid) event.getSource();
                ListGridRecord selected = lg.getSelectedRecord();
                if (selected != null) {
                    AlertDefinition alertDef = getDataSource().copyValues(selected);
                    int resourceId = alertDef.getResource().getId();
                    int alertDefId = alertDef.getId();
                    String link = LinkManager.getSubsystemAlertDefinitionLink(resourceId, alertDefId);
View Full Code Here

    @Override
    protected void configureTable() {
        super.configureTable();
        List<ListGridField> fields = getDataSource().getListGridFields();
        ListGrid listGrid = getListGrid();
        listGrid.setFields(fields.toArray(new ListGridField[fields.size()]));
        showActions();

        for (ListGridField field : fields) {
            // adding the cell formatter for name field (clickable link)
            if (PartitionEventDatasourceField.FIELD_EVENT_TYPE.propertyName().equals(field.getName())) {
View Full Code Here

        List<ListGridField> fields = createListGridFields();

        setListGridDoubleClickHandler(new DoubleClickHandler() {
            @Override
            public void onDoubleClick(DoubleClickEvent event) {
                ListGrid lg = (ListGrid) event.getSource();
                ListGridRecord selected = lg.getSelectedRecord();
                String url = getResourceTypeTableUrl(selected);
                if (url != null) {
                    CoreGUI.goToView(url);
                }
            }
View Full Code Here

            layout.addMember(titleBar);

            SectionStack sectionStack = new SectionStack();
            sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);

            ListGrid platformsList = getCustomResourceTypeListGrid();
            SectionStackSection platforms = new SectionStackSection(MSG.view_adminTemplates_platforms());
            platforms.setExpanded(true);
            platforms.addItem(platformsList);

            ListGrid platformServicesList = getCustomResourceTypeListGrid();
            SectionStackSection platformServices = new SectionStackSection(MSG.view_adminTemplates_platformServices());
            platformServices.setExpanded(true);
            platformServices.addItem(platformServicesList);

            TreeGrid serversTreeGrid = new CustomResourceTypeTreeGrid();
View Full Code Here

        VLayout listLayout = new VLayout(0);
        listLayout.setWidth100();
        listLayout.setHeight100();

        ListGrid listGrid = new ListGrid() {
            @Override
            protected Canvas getExpansionComponent(ListGridRecord record) {
                Canvas canvas = super.getExpansionComponent(record);
                canvas.setPadding(5);
                return canvas;
            }
        };
        listGrid.setWidth100();
        listGrid.setHeight100();
        listGrid.setCanExpandRecords(true);
        listGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD);
        listGrid.setDetailField("result");
        ListGridField step = new ListGridField("description", MSG.view_remoteAgentInstall_step());
        ListGridField result = new ListGridField("result", MSG.view_remoteAgentInstall_result());
        ListGridField resultCode = new ListGridField("resultCode", MSG.view_remoteAgentInstall_resultCode(), 90);
        ListGridField duration = new ListGridField("duration", MSG.common_title_duration(), 90);
        listGrid.setFields(step, result, resultCode, duration);
        listGrid.setData(getStepRecords(info));
        listGrid.setAutoFitData(Autofit.BOTH);
        listGrid.setLeaveScrollbarGap(false);
        listGrid.setShowAllRecords(true);
        listGrid.setBodyOverflow(Overflow.CLIP_H);
        listGrid.setOverflow(Overflow.SCROLL);
        listLayout.setLeaveScrollbarGap(true);
        listLayout.addMember(listGrid);
        listCanvas.setCanvas(listLayout);
        listCanvas.setOverflow(Overflow.AUTO);
        listLayout.setOverflow(Overflow.AUTO);
View Full Code Here

    @Override
    protected void configureTable() {
        super.configureTable();
        List<ListGridField> fields = getDataSource().getListGridFields();
        ListGrid listGrid = getListGrid();
        listGrid.setFields(fields.toArray(new ListGridField[fields.size()]));
        if (showActions) {
            listGrid.sort(FIELD_NAME, SortDirection.ASCENDING);
            showCommonActions();
        } else if (isAffinityGroupId) {
            listGrid.sort(FIELD_NAME, SortDirection.ASCENDING);
            // displayed from AffinityGroupDetailView
            showUpdateMembersAction();
        } else {
            // sorting by order field (displayed from AgentDetailView)
            listGrid.sort(FIELD_ORDINAL.propertyName(), SortDirection.ASCENDING);
        }
        for (ListGridField field : fields) {
            // adding the cell formatter for name field (clickable link)
            if (FIELD_NAME.equals(field.getName())) {
                field.setCellFormatter(new CellFormatter() {
View Full Code Here

            public void onSuccess(List<SavedSearch> result) {
                try {
                    long fetchTime = System.currentTimeMillis() - startTime;
                    Log.debug(result.size() + " saved searches fetched in: " + fetchTime + "ms");

                    ListGrid searchBarPickListGrid = searchBar.getPickListGrid();
                    DataSource ds = searchBarPickListGrid.getDataSource();

                    if (null == ds) {
                        ds = new DataSource();
                        ds.setClientOnly(true);
                        DataSourceTextField valueField = new DataSourceTextField(ATTR_ID, "Id");
                        valueField.setPrimaryKey(true);
                        ds.setFields(valueField);
                        searchBarPickListGrid.setDataSource(ds);

                    } else {
                        ds.invalidateCache();
                    }

                    for (SavedSearch savedSearch : result) {
                        Log.debug("savedSearch: " + savedSearch.getName());
                        ListGridRecord record = new ListGridRecord();
                        record.setAttribute(ATTR_ID, savedSearch.getId());
                        record.setAttribute(ATTR_KIND, "Saved");
                        record.setAttribute(ATTR_NAME, savedSearch.getName());
                        record.setAttribute(ATTR_DESCRIPTION, savedSearch.getDescription());
                        record.setAttribute(ATTR_PATTERN, savedSearch.getPattern());
                        if (savedSearch.getResultCount() != null)
                            record.setAttribute(ATTR_RESULT_COUNT, savedSearch.getResultCount());
                        ds.addData(record);
                    }

                    try {
                        searchBarPickListGrid.setData(new ListGridRecord[] {});
                        searchBarPickListGrid.fetchData();
                    } catch (Exception e) {
                        Log.debug("Caught exception on fetchData: " + e);
                    }
                } finally {
                    isSearchInProgress = false;
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.grid.ListGrid

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.