Announcement

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

    ListGrid rows that are not associated with the DataSource

    Can I have rows in a ListGrid that are not associated with the grids DataSource.

    For example I have a ListGrid that contains a list of groups where each group can have any number of members. The groups displayed are backed by a DataSource. What I would like is to be able to have an extra item in the ListGrid for a 'special' All group that everyone is always a member of.

    Is this possible?

    I could generate the All group on the server side, but it makes more sense to handle it client side as the server really doesn't need to know about it.

    #2
    That's almost the same as ListGrid's groupByFields functionality, have you seen it?

    Comment


      #3
      I haven't, will look at it now. thanks

      Comment


        #4
        not really what I need. I need the All group to appear as a record in the ListGrid such that if I select it (or any group) I can display all the members of that group in another control.
        I don't want to display the groups and their members in the same control.

        Comment


          #5
          So if this is basically a second grid that just shows the groups, it doesn't seem like it should have the same DataSource (no fields in common, right?). Just use setData() to populate it with whatever data you want.

          Comment


            #6
            Yes the second control could be a grid, with each grid having a different DataSource. The first grid is bound to the groups data source, and when a selection from the grid is made a fetch is (ultimately) done on the second data source it returns all the members of the selected group.

            What I'd like is to have an item "All" in the first grid, as well as all the records returned by the data source.

            Comment


              #7
              A SelectItem with optionDataSource and allowEmptyValue:true can show an extra item like "All". If you want something more like a multi-select, however, this won't work, but you can call DataSource.fetchData() directly, add your "all" item to the data, and then provide the data to a ListGrid using setData().

              Comment

              Working...
              X