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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom Command Edit Example Does Not Work

Thread ID:

Created:

Updated:

Platform:

Replies:

142506 Feb 6,2019 10:02 PM UTC Feb 8,2019 10:53 AM UTC ASP.NET Core - EJ 2 3
loading
Tags: DataGrid
Eugene Fong
Asked On February 6, 2019 10:02 PM UTC

The custom command edit code in the Documentation does not work.

See below code:

@{

    List<object> commands = new List<object>();
    commands.Add(new { type = "userstatus", buttonOption = new { content = "Details", cssClass = "e-flat e-details" } }); // custom
}

<div class="control-section">
    <ejs-grid id="Grid" dataSource="ViewBag.dataSource" load="load" allowPaging="true">
        <e-grid-editSettings allowAdding="false" allowDeleting="false" allowEditing="true"></e-grid-editSettings>
        <e-grid-columns>
            <e-grid-column field="OrderID" headerText="Order ID" validationRules="@(new { required=true})" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
            <e-grid-column field="Verified" headerText="Verified" editType="booleanedit" displayAsCheckBox="true" textAlign="Center" type="boolean" width="100"></e-grid-column>
            <e-grid-column headerText="Manage Records" width="150" commands="commands"></e-grid-column>
        </e-grid-columns>
    </ejs-grid>
</div>
<script>
    function load() {
        this.columns[2].commands[0].buttonOption.click = function (args) {     //click event for custom command button
                var grid = document.getElementsByClassName('e-grid')[0].ej2_instances[0];  // grid instance
                var rowObj= grid.getRowObjectFromUID(ej.base.closest(args.target, '.e-row').getAttribute('data-uid'));
                alert(JSON.stringify(rowObj.data));  // display row data 
        }
    }
</script>



Thavasianand Sankaranarayanan [Syncfusion]
Replied On February 7, 2019 05:42 AM UTC

Hi Eugene, 

Greetings from Syncfusion. 

We have prepared a sample with the given code example but we are unsuccessful to reproduce the issue from our end. Sample can be downloadable from the below location. 


Provide the following details for better assistance from our end. 

  1. Share screen shot or video demonstration of the issue.
  2. Share the replication procedure to reproduce the issue.
  3. If possible try to reproduce the issue in the attached sample.
  4. Share the Essential Studio version details.

Regards, 
Thavasianand S. 


Eugene Fong
Replied On February 7, 2019 05:23 PM UTC

Hi Eugene, 

Greetings from Syncfusion. 

We have prepared a sample with the given code example but we are unsuccessful to reproduce the issue from our end. Sample can be downloadable from the below location. 


Provide the following details for better assistance from our end. 

  1. Share screen shot or video demonstration of the issue.
  2. Share the replication procedure to reproduce the issue.
  3. If possible try to reproduce the issue in the attached sample.
  4. Share the Essential Studio version details.

Regards, 
Thavasianand S. 


Support,

Including EJ1 ASP.NET CORE controls will break the code.  Please provide the same example with a mix of EJ1 controls and the EJ2 Grid.



Thavasianand Sankaranarayanan [Syncfusion]
Replied On February 8, 2019 10:53 AM UTC

Hi Jenny 

As per your suggestion we have prepared a sample with mix of ej1 and ej2. Sample can be downloadable from the below location. 


Refer the help documentation for more details. 



Regards, 
Thavasianand S. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;