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. Image for the cookie policy date
close icon

Custom Command Edit Example Does Not Work

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>



3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team 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. 



EF Eugene Fong replied to Thavasianand Sankaranarayanan 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.




TS Thavasianand Sankaranarayanan Syncfusion Team 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. 


Loader.
Live Chat Icon For mobile
Up arrow icon