Open Closed

Actions column will disappear after 1 second while page rendered #2710


User avatar
0
zhongfang created
  • ABP Framework version: v5.1.4
  • UI type: MVC + Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • No exception, only Actions column disappear automatically
  • Steps to reproduce the issue:"
  • Create a moduler solution named Yee.Change.Config
  • modify a const string ase below. The original value is "Config", but I am afraid this simple word will conflict to other module in the future. So I modify to Config.
namespace Yee.Change.Config.Permissions;

public class ConfigPermissions
{
    public const string GroupName = "ChangeConfig";
  • Now the pages in Web project, the first column named Actions in all tables will disappear after page render.

4 Answer(s)
  • User Avatar
    0
    zhongfang created

    I have found the code which control the visibility of buttons in Actions column as below. the parameter are all started with "Config. If I modify from Config to ChangeConfig, it will be OK?

    var dataTable = $("#AgentLevelsTable").DataTable(abp.libs.datatables.normalizeConfiguration({
            processing: true,
            serverSide: true,
            paging: true,
            searching: false,
            scrollX: true,
            autoWidth: false,
            scrollCollapse: true,
            order: [[1, "asc"]],
            ajax: abp.libs.datatables.createAjax(agentLevelService.getList, getFilter),
            columnDefs: [
                {
                    rowAction: {
                        items:
                            [
                                {
                                    text: l("Edit"),
                                    visible: abp.auth.isGranted('Config.AgentLevels.Edit'),
                                    action: function (data) {
                                        editModal.open({
                                         id: data.record.id
                                         });
                                    }
                                },
                                {
                                    text: l("Delete"),
                                    visible: abp.auth.isGranted('Config.AgentLevels.Delete'),
                                    confirmMessage: function () {
                                        return l("DeleteConfirmationMessage");
                                    },
                                    action: function (data) {
                                        agentLevelService.delete(data.record.id)
                                            .then(function () {
                                                abp.notify.info(l("SuccessfullyDeleted"));
                                                dataTable.ajax.reload();
                                            });
                                    }
                                }
                            ]
                    }
                },
    			{ data: "levelId" },
    			{ data: "levelName" },
    			{ data: "desc" },
    			{ data: "needFans" },
    			{ data: "needConsumerAmount" },
                {
                    data: "isActive",
                    render: function (isActive) {
                        return isActive ? l("Yes") : l("No");
                    }
                }
            ]
        }));
    
  • User Avatar
    0
    zhongfang created

    Otherwise, may ABP framework use a const string in Javascript , and this const string equals to this member:

    public class ConfigPermissions
    {
        public const string GroupName = "ChangeConfig";
    
  • User Avatar
    0
    zhongfang created

    I replaced all abp.auth.isGranted('Config. with abp.auth.isGranted('ChangeConfig.

    The problem has been resolved.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi You questions count has beed refunded.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35