Grid Insert

  1. #1

    Grid Insert

    Hi,

    I am new to Coolite. Just trying with the Demo given in example.

    While trying the demo I found an issue with inserting the record.

    I click twice the insert button so the grid created two rows. I entered values in one row and tried to save the grid. In that demo there is an validation for state column to select 'AL' so the empty row trigered the validation and the validation fails so the system shows the validation message.

    Then I removed the empty row and tried to save. there was an another error then I tried to refresh the grid. Once the grid is refreshed I could see two rows updated with the same data(duplicates) where as I filled in only one row.

    Please, comment on this.

    Thanks

    Alagappan Venkatachalam
  2. #2

    RE: Grid Insert

    Hi,

    Do you have that problem with original example or change that example? I can't reproduce the problem on that example
  3. #3

    RE: Grid Insert

    Hi Vladimir.

    Here with I attached the screen shots of the steps which I carried out.

    This steps have been executed in the project which installed locally using Community Edition installation package.

    Example : DataSource Update

    Step 1: I have clicked the Insert button twice
    Step 2: Just filled the values in second row and leaving the first row as empty
    Step 3: Trying to save, the first empty row triggers validation for invalid state
    Step 4: Deleted the first empty row
    Step 5: After clicked on save button, the saved record is duplicated.

    FYI, I am using Windows Server 2003 std, SQL Server Std 2005, Visual Studio 2008, & Internet Explorer v 8.


    Thanks

    Alagappan Venkatachalam
  4. #4

    RE: Grid Insert

    Hi,

    Yes, it is possible in that example. It is defect of example (not toolkit).


    Let me explain:


    - The validation performed in BeforeInsert handler. The valid (second) row is saved to DB but invalid (first) row marks saving request as failed. Therefore the grid stay all (both) rows as unsaved and try to save second row again (when you click save). It is need to use transaction in that example and cancel all DB operations if one row is not valid (or check all rows before start of saving to the DB)


    Also you can use Confirmation (each row should be confirmed). In this case the grid can get information which row saving success or failed


    https://examples1.ext.net/#/GridPane.../Confirmation/


  5. #5

    RE: Grid Insert

    Hi,

    What is confirmation?. You told me each row should be confirmed. can you please explain me bit about this.

    Thanks in advance and your speedy guidance is more appreciated.

    Best Regards,
  6. #6

    RE: Grid Insert

    Hi,

    Confirmation using to confirm each action for each. If deleting/updating/inserting row was successfully then you shoud confirm it. The grid commit changes on client side after confirmation only. Even if success was for several rows only the grid commit that rows and other (failed) will still marked as unsaved


    In the example from above post you can to see how to confirm row
  7. #7

    RE: Grid Insert

    Hi,

    I understood that the once the record is confirmed as saved in the client side then when the next save request the confirmed record will not get duplicated.


    In your SQL Data source example. The confirmation is being used in Store1_AfterRecordInserted but still why the duplication appears.


    Also,Now I am trying with my own test project. I am using LinqDataSource to load the DataStore.


    As you told in the previous post I refered the Web Service confirmation example but in my case using LinqDataSource how should I take the StoreDataHandler As I don't want to use Webservice/HttpHandlers to save the data.


    Thanks
  8. #8

    RE: Grid Insert

    Hi,

    For example use OnAfterRecordInserted/Deleted/Updated handler to confirm record
    e.Confirmation.ConfirmRecord(insertedValue);
  9. #9

    RE: Grid Insert

    Hi,

    I found the defect which duplicates the rows. I am working on fix.
    For solve problem on your side just remove Store1_AfterAjaxEvent handler or just replace code
    e.Response.Success = !cancel;

    by any code which showing warming alert like Ext.Msg.Alert

Similar Threads

  1. Replies: 12
    Last Post: Aug 03, 2012, 1:49 PM
  2. [CLOSED] Insert false rows in the grid.
    By stoque in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 09, 2011, 7:59 AM
  3. Replies: 4
    Last Post: Oct 07, 2011, 10:49 AM
  4. [CLOSED] Insert Grid Record - Edit First Cell?
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 10, 2011, 11:01 AM
  5. [CLOSED] Insert Record into grid
    By sharif in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 08, 2010, 2:16 PM

Posting Permissions