inline edit issue


I am trying to implement the inline editing with grid inside a modal.
When I am adding or editing some data, it is successfully getting added or updated to the grid.
But when I am trying to fetch the whole grid data on modal button click, some issue occurs.
Like if I am adding a new data, it gets stored in the [0] index of the array. Then again when I am updating something, its replacing the newly added element and getting stored in the [0] index.

So can you please tell me how to fetch the grid data(new or updated data) on click of modal button?

I have updated the grid to the latest version. 
I have attached a sample. 


Could you please take a look into it?

Thanks.

Attachment: githublushmubbh78w_c5a1ec83.zip

3 Replies

MF Mohammed Farook J Syncfusion Team June 12, 2018 07:43 AM UTC

Hi Ananya, 
 
Thanks for contacting Syncfusion support. 
 
 
In your sample, for button click handlers, the context (this) is set to EJ2 DialogCompoent.  So please use the following codes for changing the handler context (‘this’) to access AppComponent variables and its methods. 
 
 
this.buttons = [ 
            { 
                'click': this.fetchData.bind(this), // update your code 
                // Accessing button component properties by buttonModel property 
                buttonModel: { 
                    content: 'OK', 
                    cssClass: 'e-flat', 
                    //Enables the primary button 
                    isPrimary: true 
                } 
            }, 
            { 
                'click': this.closeModal.bind(this),// update your code 
                buttonModel: { 
                    content: 'Cancel', 
                    cssClass: 'e-flat' 
                } 
            } 
        ]; 
 
 
Please find the modified sample for your reference. 
 
 
Please find the screenshot for your reference. 
 
To fetch data when button click 
 
 
 
To fetch data after adding new record: 
 
 
 
To fetch the data after updating 
 
 
 
Also you have mentioned as when I am updating something, its replacing the newly added element and getting stored in the [0] index in your query, but it worked fine at our end. Hence please check the modified sample and get back to us if the issue persisted. 
 
Regards, 
J Mohammed Farook 
 



AJ Ananya Juhi June 14, 2018 02:29 PM UTC

Thanks for the update.
I can now fetch the data from the grid.


MF Mohammed Farook J Syncfusion Team June 18, 2018 05:46 AM UTC

Hi Ananya, 
 
Thanks for your feedback. 
 
We are happy to hear that you have achieved your requirement.  
 
Please get back to us if you need further assistance.  
 
Thanks, 
J Mohammed Farook 


Loader.
Up arrow icon