Announcement

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

    SQL datasource reducing selected fields

    Hi,

    We have a few large tables (>300 columns) where users typically select to view only around 30 in the grid.
    However, default select query in sqldatasource selects all columns. I tried controlling it by defining
    grid.setUseAllDataSourceFields(false);
    rid.setShowHiddenFields(false);

    But none of these do exactly what's needed, so now I'm passing a list of actually visible/selected fields in the criteria as SelectedFields and using
    <operationBinding operationType="fetch">
    <selectClause>$criteria.SelectedFields</selectClause>
    </operationBinding>

    However since there are single quotes added around resolved value for SelectedFields this does not work either.

    Any suggestions?

    Thanks!

    #2
    Hi smartiro,

    use setOutputs() in the requestProperties of your fetchData()-call.

    Best regards
    Blama

    Comment


      #3
      Hi again,

      if you want to target all fetch-requests by the ListGrid (e.g. when filtering), see dataProperties here.

      Best regards
      Blama

      Comment


        #4
        Hi Blama.

        setOutputs() worked - thanks a lot!

        Comment

        Working...
        X