Announcement

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

    Modify display value of listGridField with an optionDataSource

    I have a listgrid defined like the following:

    Code:
    isc.ListGrid.create({
        dataSource: 'mainDataSource',
        fields: [
            { name: "person_id", width:"*", editorType: "select",
                optionDataSource:"userEntityDataSource", optionCriteria: { type: 'manager' },
                valueField:"tutor_id", displayField: 'firstname'
            },
            { name: "thing", width:"25%" },
            { name: "start_date", width:"*" },
        ]
    })
    Instead of using a displayField for person_id, I want to use a custom formatter so that I can return a formatted version of the person name. My datasource (userEntityDataSource) returns title, firstname and surname which I need to concatenate.

    Any help on this would be greatly appreciated, thank you.


    #2
    Please see this sample. Use listGridField.editorProperties to apply the necessary settings to the SelectItem used for editing in the grid.

    Comment


      #3
      Thank you for the quick reply.

      That is not quite what I am after.

      It is not the editor that is an issue, it is just the display of a value in the listgrid.

      Comment


        #4
        Pulling fields from a related DataSource is generally achieved by a database join. If you are using our server framework with one of the built-in connectors (SQL, JPA, Hibernate) this is as simple as declaring dataSourceField.includeFrom. If you aren't, you still want the same result, so read the includeFrom docs anyway.

        Comment

        Working...
        X