1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    mahanagarjuna is on a distinguished road

      0  

    Default GXT 3.0 ListView - Icon + String

    GXT 3.0 ListView - Icon + String


    Hi,

    I am new to GWT/GXT and I need to create a ListView which shows list of Strings with Icons to the Left.

    Using templates it seems do able, but not sure how. Need help.

    Thanks in advance!

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,756
    Vote Rating
    113
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    I would use a CompositeCell that containts the ImageResourceCell and a SafeHtmlCell. All comming from GWT.

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Location
    Arizona
    Posts
    47
    Vote Rating
    0
    jdkida is on a distinguished road

      0  

    Default


    Hi Sven,

    I am trying to do the same thing. I got it working with a static icon, but what if I want to use the icon from the model? i.e I have a model that provides an ImageResource, how can I show the image next to the the model string.. Here is what I have so far.. but like i said this will only show a single image, how can I pull the image from the model.

    Code:
            resources = GWT.create(AppResources.class);
    
            navStore = new ListStore<NavigationPaneSectionModel>(props.key());
            navStore.add(new NavigationPaneSectionModel("accounts", resources.note(), "Accounts"));
            navStore.add(new NavigationPaneSectionModel("tickets", resources.bino_search(), "Tickets"));
            navStore.add(new NavigationPaneSectionModel("leads", resources.email_add(), "Leads"));
            
            IconCellDecorator<String> iconCell = new IconCellDecorator<String>(resources.note(), new TextCell());
    
            navList = new ListView<NavigationPaneSectionModel, String>(navStore, props.displayLabel());
            navList.setCell(iconCell);
            this.setWidget(navList);

Tags for this Thread