- Home
- Forum
- ASP.NET Core - EJ 2
- Custom Command Edit Example Does Not Work
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>
SIGN IN To post a reply.
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.
Sample: http://www.syncfusion.com/downloads/support/forum/142506/ze/WebApplication1_(7)1718843940.zip
Provide the following details for better assistance from our end.
- Share screen shot or video demonstration of the issue.
- Share the replication procedure to reproduce the issue.
- If possible try to reproduce the issue in the attached sample.
- Share the Essential Studio version details.
Regards,
Thavasianand S.
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.
Sample: http://www.syncfusion.com/downloads/support/forum/142506/ze/WebApplication1_(7)1718843940.zip
Provide the following details for better assistance from our end.
- Share screen shot or video demonstration of the issue.
- Share the replication procedure to reproduce the issue.
- If possible try to reproduce the issue in the attached sample.
- 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.
Sample: http://www.syncfusion.com/downloads/support/forum/142506/ze/WebApplication1_(8)121062595.zip
Refer the help documentation for more details.
Regards,
Thavasianand S.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
EF Eugene Fong
- Feb 6, 2019 10:02 PM UTC
- Feb 8, 2019 10:53 AM UTC