如何在列属性中渲染多个按钮?

发布于 2025-01-28 03:24:37 字数 631 浏览 3 评论 0原文

我有一个实体数据。

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

在Web视图中,它显示为

​i1nhs.png“ rel =” nofollow noreferrer“>

我该怎么做?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

溺渁∝ 2025-02-04 03:24:37

您可以使用

Render = new RenderCustom("ColumnBtns")

,然后

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)
    }

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)
    }

韵柒 2025-02-04 03:24:37
        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>                                   
        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>                                   
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文