Loading ...
Sorry, an error occurred while loading the content.

Inserting a row into a DataTable with a remote DataSource

Expand Messages
  • palcoy
    Hi All, I have a paged DataTable, and have made a Dialog that pops up when clicking on a row. The Dialog is populated with the contents of the row that was
    Message 1 of 1 , Jul 6, 2009
    • 0 Attachment
      Hi All,

      I have a paged DataTable, and have made a Dialog that pops up when clicking on a row. The Dialog is populated with the contents of the row that was clicked, and on submission sends the update back to the server.

      I'm wanting to implement a button to add a new row of data to the table.
      The way I was thinking this might work is to:
      - Tell the Paginator to go to page 1.
      - Insert a new row into the DataTable at position 0.
      - Open the editing Dialog, populated with empty values.

      I've managed the first two by subscribing to the postRenderEvent of the DataTable and checking to see if an insert is pending (made a bool for this), otherwise the inserted row would get overwritten when the data for that page came back.

      The third part is where I am stuck. I've tried to fire the onRowClickEvent, but can't seem to pass in a reference to the newly created row.

      It'd be great if somebody could offer me some advice on this. Or even tear my idea to shreds, and offer a better way :)

      Thanks.
    Your message has been successfully submitted and would be delivered to recipients shortly.