Announcement

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

    ListGrid + binary field + filterEditor on filename?

    I've got a DataSource in a .ds.xml file with binary data corresponding to a file in one of the fields, and I want to display this in a ListGrid.

    My objectives are:
    1) Somewhere in the record, I want to display the download icon, the view icon, and the filename.
    2) I want to let users use the filterEditor to search by filename. Unfortunately, the filter editor component above my type="binary" is not a text editor. So right now, I'm displaying another field type="text" with the filename.
    3) I don't want to display the filename in two fields (once to get the icons, and again to enable filtering).

    There seem to be 3 approaches to meeting all objectives together:
    a) Remove the binary field altogether and implement a mechanism independent of the ListGrid for viewing/downloading.
    b) Find a way to get the type="binary" field to allow filtering based on the filename
    c) Use two fields, and find a way to suppress the appearance of the filename in the type="binary" field.


    I can work out a) on my own, but is there any way to get options b) or c) to work?

    #2
    The default appearance of a binary field in a ListGrid is a download icon, view icon and filename. That seems to be meet objective 1.

    You can use listGridField.filterEditorType to provide your own filtering interface, and set criteriaField so that this editor produces criteria that applies to the (hidden) filename field instead of to the binary field as such.

    Comment


      #3
      Thanks! For future googlers, here's a working example:

      Code:
      <DataSource ID="structureDS" serverType="sql" tableName="structure">
          <fields>
              <field name="ID" type="sequence" hidden="true" primaryKey="true"/>
              <field name="structure" type="binary" filterEditorType="TextItem">
                 <filterEditorProperties criteriaField="structure_filename" />
              </field>
          </fields>
      </DataSource>

      Comment


        #4
        We've also decided that this behavior makes sense as part of the default implementation so we've made this happen automatically for ListGrids showing the filter editor for binary fields where the filename is available.

        This will be present in the framework (10.0 SmartClient branch / 5.0 SmartGWT branch only) going forward.

        Regards
        Isomorphic Software

        Comment

        Working...
        X