Announcement

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

    searching inside a ListGrid

    Hi all,

    I would like to search for specific records in a ListGrid, so that I can select them. What is the recommended way of doing this?

    I do not want to modify the content of the ListGrid, so using a fetchData on the grid does not seem to be the solution.

    Should I run the search using fetchData on the underlying dataSource? If so, how do I find the records in the ListGrid, based on the results?

    Or should I read out the data using getRecords(), and perform the search manually?

    Or something else?

    Whatever is the solution, how does this interact with the pagination support?

    Thank you for your help!

    #2
    If there's a strong possibility the data is locally loaded, use listGrid.getResultSet(), and take a look at the various ResultSet APIs that would allow you to determine whether all the data is local, such as willFetchData(Criteria).

    Comment


      #3
      I need to be able to tell whether a record with a given Key exists, either locally or on the server. (Matching the current criteria, of course.)

      Furthermore, ideally I would need this data immediately - I mean, without a server round-trip. Is there a mechanism to load just the list of keys (from the results of a query) from the server to the client, so that later the client can immediately tell if a given record exists?

      * * *

      The other think I need is to select a record based on primary key.
      Now this is easy if the record is already loaded, but how to do this if it is not? Ideally, I would just mark it for selection, and when the data is actually loaded (because the user scrolls down), it would appear selected.

      Is just thing supported, or do I have to do this manually?
      (dataArrived is called every time new data is fetched from the server, right?)

      Comment


        #4
        Originally posted by csillag
        Is there a mechanism to load just the list of keys (from the results of a query) from the server to the client, so that later the client can immediately tell if a given record exists?
        If I would like to implement this, what would be the right point to override the default process at the server side?

        Comment


          #5
          Originally posted by csillag
          If I would like to implement this, what would be the right point to override the default process at the server side?
          Maybe the easiest way to do this would be to create a view of the same data that would only contain the keys. Can I do this by defining an other DS which inherits from the original one? If I do this, what do I have to configure? setting hidden="true" on fields is obviously not enough, since the data is still transferred to the client. Can i use ignore="true"?
          The challenge here is that I still need to be able to filter the data using criteria... what would be the appropriate configuration here?

          Thank you for your help!

          Comment


            #6
            Your use case isn't clear enough to suggest an approach, but see operationBinding.outputs for limiting output fields, listGrid.findRecordById, and the various find*() methods on RecordList / ResultSet.

            Comment

            Working...
            X