Hi Team
1) If the user clicks on Add link in iggrid
2) Fills the details in the grid columns
3) Without clicking Done or Cancel if the user comes out of the grid by clicking on any other part of the page or on next row.
4) The data which was entered after clicking Add gets lost. Can we popup save confirmation message in iggrid when user Clicks Add but doesn't clicks done or Cancel
5) I couldn't find any event where I can put this validation.
6) Please refer the attached image "AddRowValidation.jpg" for graphical details of the point.
Any assistance is highly appreciated.
Thanks.
Hi Ankush Mahajan,
Thank you for posting on our forums.
I recommend using the igGridUpdating EditRowEnding event to perform this validation on the client. To experience this event firing, please review the sample linked below:http://igniteui.com/grid/editing-api-events
Also, to learn more about the igGridUpdating feature, please review the igGridUpdatingEditRowEnding API documentation.
Please let me know if you have any questions regarding this matter.
Hi jose,
I tried to do validation on igGrid using the igGridUpdating EditRowEnding Event. However When i Click on Ok Button,
data which was entered in grid get lost.
Below is the code and screen-shot of Grid:
{ name: 'Updating', editMode: pickListGridEditMode, enableAddRow: pickListGridEditMode == 'none' ? false : true, enableDeleteRow: pickListGridEditMode == 'none' ? false : true, editRowEnding: function(evt, ui) { alert("ok"); },
1. New row is entered as For eg: aaaa
2. Before clicking done or cancel button , I click on any other row of Grid, Message Popup and then I click on ok button
3. Data entered (aaaa) got lost.
So My requirement are:
1. I don't want to loss data after clicking on confirmation message, means data should remain in grid when i click on any other row of grid.
2. When Confirmation Message popup , and then if user clicks ok, then it should save in database.
Early response is highly appreciated !!!
Thanks,
Ankush
H Jose,
Please find below screen shot for above scenario:
Step1: I have added new row as (aaaa)
Step2: After adding new row, with out clickin on done/cancel button i click on any other row of grid
Message popup written on Editrowending event of grid, Then i click on ok button given in below screen-shot
Step3 : New row added in grid got lost.
Thank you for the update.
The behavior you're encountering is the default behavior of the igGrid. Essentially, the Alert window is forcing the user to click on it in order to acknowledge it. This in turn will relieve focus on the igGrid, which causes the AddRow to remove it's values. To alter this, you can get the values of the AddNewRow using the igGridUpdatingEditRowEnding event, which should fire before the values are lost, and add those values to a new row on the grid. You can get the values in the cells using the ui.values option, and add the values to the igGrid using the AddRow method.