Announcement

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

    Blank row in ListGrid for adding a new record

    Hi Team,

    To add a new record in a ListGrid, we need to always show an empty row in the ListGrid itself. In other words, in the list grid, along with the fetched records, there should be a blank row. The user should be able to enter values in it and it should get saved in the DataSource.

    Could you please guide us as to how should we go ahead with this requirement.

    Note: We are able to add a new blank record by listGrid.startEditingNew() on click of a button (outside of listgrid). But in this case the editable record gets removed once the focus is lost from this new record (it cannot even be selected). We want the new editable record to be present always so that we can also paste the values in that from other records.

    We are using SmartGwt version 6.1-p20170724.

    Thanks

    #2
    New, unsaved records are not lost on lack of focus. If you believe that is happening, you should look at the numerous Showcase examples that show it does not actually happen, but then, if you are still convinced it's a framework bug, you should create a ready-to-run, minimal test case showing the problem.

    As far as different ways of handling new, unsaved records, you just haven't read the docs: see the Grid Editing overview, and the linked topic on Unsaved Records.

    Comment


      #3
      Thanks for the quick response.

      We have read the docs already (Unsaved records). But we have this specific requirement (of empty record being present always that can be used to add the new record). Is there any case where we can see such implementation (if already present in any of the use-case). Or is there a way to open a Change Request for your team and then you can help us in implementing this.

      Thanks.

      Comment


        #4
        We're not sure what you're asking here, but, if you want an empty record to be always available for adding new records, you can simply call startEditingNew() every time a new record is saved.

        This seems so obvious that it can't be your question, so if this didn't help, please give a much clearer description of what you want.

        Comment

        Working...
        X