We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

EJGRID | Add Button Programmatically

Thread ID:

Created:

Updated:

Platform:

Replies:

119667 Jul 20,2015 02:20 PM Jul 21,2015 07:20 AM JavaScript 3
loading
Tags: ejGrid
David Almas
Asked On July 20, 2015 02:20 PM

Hello,

I wonder what are the methods used in the grid because i need to make a customized buttons like add, remove and edit the line

As image: 



Thank you

David Almas

David Almas
Replied On July 20, 2015 03:16 PM

Resolved with addRecord() Method.

Thank you

David Almas
Replied On July 20, 2015 05:52 PM

Hi again,

What can i do to save row when i do a addRecord() method ?

Thanks

Gowthami V [Syncfusion]
Replied On July 21, 2015 07:20 AM

Hi David,

Thanks for using Syncfusion products.

Query 1: what are the methods used in the grid because i need to make a customized buttons like add, remove and edit the line

Please refer the below link for performing add, remove and edit the record externally.

For adding the row: http://helpjs.syncfusion.com/js/api/ejgrid#methods:addrecord

For delete the record: http://helpjs.syncfusion.com/js/api/ejgrid#methods:deleterecord

For Edit the record: http://helpjs.syncfusion.com/js/api/ejgrid#methods:startedit

For saving the record: http://helpjs.syncfusion.com/js/api/ejgrid#methods:endedit

Query 2: What can i do to save row when i do a addRecord() method ?

We can add the record in two ways externally by using addRecord method.

1.       We can add the empty record and then add the corresponding fields then we can save the added/edited record using “endEdit” method of the grid as follows.

//Getting instance of the grid

var gridObj = $("#Grid").data("ejGrid");

//Add the below code to the click event of the external button “Adicionar” for add the record

gridObj.addRecord();

               

//Add the below code to the click event of the external button “Guardar” for sending save request

gridObj.endEdit();


2.       We can add the record by passing the record to the addRecord method itself as follows.


var gridObj = $("#Grid").data("ejGrid");


//Use the below code for add and save the record automatically without calling the method “endEdit” .

gridObj.addRecord({OrderID:12333});


While using above code snippet, there is no need to send the save request using “endEdit” method. The added record will automatically get saved.

Please let us know if you have any queries.

Regards,
Gowthami V.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;