Announcement

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

    Fetching data from DB and adding data from cache

    Within a DMI fetch call, is there a way to distinguish between "clean" data pulled directly from the database, and new "dirty" data that would need to be saved or discarded?

    Specifically, we want to get existing data from our DB, as well as records imported from a spreadsheet (which resides in the cache at the time of the fetch). After populating the ListGrid with both clean and dirty data, we want to be able to either click save or discard.

    We are using 8.2 Power Edition, and require Internet Explorer as our browser.
    Last edited by subashk; 26 Apr 2012, 09:57.

    #2
    You would need to add an extra attribute to the records that originate from the spreadsheet.

    Comment


      #3
      Alright, so how do I make the UI show that these are new rows? I can display the additional rows from the fetch, but they appear as if they are existing rows. (New rows have different text color and such). Also when I click my save button, my new rows do not get sent as part of the save. (Again, because the list grid is not aware that these are new/modified records that do not exist in the database.)

      Please advise.

      Comment


        #4
        You can add a series of rows that are considered as user-added rows via repeated calls to startEditingNew(). They will then be saved to server with other edits.

        Comment


          #5
          We tried that as our initial solution, but it was throwing this error

          A script on this page is causing Internet Explorer to run slowly...

          as we have some validation logic when a new row is added.

          We also tried this way, by adding the object to the data of the ListGrid using .add()
          http://www.smartclient.com/docs/8.2/a/system/reference/SmartClient_Explorer.html#_Grids_Data.operations_Local.add

          get JS error saying not supported, are we missing something?

          Comment


            #6
            You could get this if you're adding a large set of records via startEditingNew(). This subsystem is designed for user edits, not import of a large dataset.

            To import a large dataset, the approach that scales best is to store it somewhere temporarily on the server, then create a DataSource that accesses that temporary store.

            Comment

            Working...
            X