skip to Main Content

I have a Entity DataTable.

   ColumnCollection = new List<ColumnProperty>
   {
             new ColumnProperty(nameof(ProductChapterMappingModel.Id))
       {
           Title = T("Admin.Common.Edit").Text,
           Width = "200",
           ClassName =  NopColumnClassDefaults.Button,
           Render = new RenderButtonsInlineEdit()
       }
   }

In the web view it is displaying like

enter image description here

This looks good but my requirement is to add another button called Details under the same column like:

enter image description here

How can I do that?

2

Answers


  1. You can use

    Render = new RenderCustom("ColumnBtns")
    

    and then

    function ColumnBtns(data, type, row, meta) {
            return 'Your HTML HERE'
           //and you can use the parameter row to reference the object represented by the   
           //row such as Id like that (row.Id)
        }
    
    
    Login or Signup to reply.
  2.         new ColumnProperty(nameof(Model.Command))
                                    {
                                        Title = T("Plugins.Misc.Sales.Fields.Command").Text,
                                        Width = "100",
                                        ClassName =  NopColumnClassDefaults.Button,
                                        Render = new RenderCustom("renderColumnBtns")
                                    }  
    
                            <script>
    
                                function renderColumnBtns(data, type, row, meta) {
                                    var editlink = '@Url.Content("~/Admin/SalesCampaigns/Edit/")' + row.Id;
                                    var detaillink = '@Url.Content("~/Admin/SalesCampaigns/Detail/")' + row.Id;
                                    
                                    return '<a class="btn btn-default"  href="' + editlink + '"><i class="fas fa-pencil-alt"></i>@T("Plugins.Misc.Sales.Edit").Text</a>  <a class="btn btn-default"  href="' + detaillink + '"><i class="fas fa-pencil-alt"></i>@T("Plugins.Misc.Sales.Detail").Text</a>';
                                }
    
                            </script>                                   
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search