This topic is locked

Inline Edit for Multiple Records

2/27/2008 9:23:24 PM
ASPRunnerPro General questions
R
rpeeks author

Dear all,
I have been following the development of the inline edit feature for a while. The post...
http://www.asprunner.com/forums/index.php?...;hl=inline+edit
...reflects pretty much what we have experinced so far.
Our scenario is as follows:
Requirements:
**** What we want to display:

  • Base table with all its records (unfiltered).
  • Filtered views(ASP Runner or SQL Server) on the base table with custom SQL queries that have a "where" filter on a "Status" field ("Open"/"Closed"/...)
    **** How we want to process the data
  • Inline Edit of one or more rows: The user clicks "Inline Edit" on e.g. ten rows, scrolls over to the right (table is about two screens wide) and updates the "Status" value for all selected fields. Then, the user scrolls back to the left and clicks the check marks for the edited records to save them.
  • The "BeforeEdit" event checks data for consistency, e.g. if a "Date Closed" field is set when record status is set to "Closed". If the "BeforeEdit" returns false, we want the record to stay in edit mode and display a message regarding the missing field. Also one r/o-field is autopopulated in the event code using a direct SQL Update in VBScript.
  • If the save of a record went through and the database has received the new values, the record should no longer be in edit mode. If the record does not meet the filter criteria anymore, it should be displayed either with its new values until the user redisplays the entire page or it should be left out of the set of records that are to be displayed. It does not make much difference how this display behavior is as long as it is consistent.
    Current Application Behavior
  • For the unfiltered base table: --> Inline editing works like a charm.
  • For the ASP Runner views with custom SQL that filter by a Status field:

    . For fields that are not in the "where" condition --> Inline editing works great as well.

    . For fields that are in the "where" condition:

    . If the value change does not exclude record from "where" filter results --> Inline editing works also great.

    . If the value change does exclude record from "where" filter results --> Inline editing works, save goes through, but the record stays in edit mode, "Error occurred" shows, even if save was successful; if no save due to the even code, it shows correctly "Error occurred" and does not save the value.
    Now, for a single record, we are almost ok using the solution in the link above, which is editing the inlineedit.js with "window.location.reload(true);return;".

    Problems with the inlineedit.js modification:
    • In case the event code sets "BeforeEdit = false" there is no error message anymore.
    • For multi row edits, only changes to the row where the checkmark is clicked are kept changes to the other editable rows are lost.
      It didn't make any difference whether ASPRunner views were used or if the records were pulled from a view directly in the SQL Server database (vw-"tables").
      My question:_ How can I implement a multi-record inline edit with event execution (validation of "BeforeEdit") that does not have conflicts with my "where" condition?
      Any pointers are greatly appreciated - thanks in advance. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=7722&image=1&table=forumtopics' class='bbcemoticon' alt=':)' />

      Ralf
      Software used _

      ASPR 5.1 build 32(6/7) --> the release we use predominantly

      ASPR 5.2 beta build 391 --> release for reproducing the inline edit behavior

      SQL Server 2005

      prd:W2k3R2/IIS6.0

      dev/tst:XP-Pro;IIS5.1