Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "greatsamps"

Hi,

I need to configure the visibility of some specific buttons on a row by row basis. For example, for some rows i might want an edit button to show, but not for others.

What we are doing is sending in the JSON two properties: CanBeEdited, CanBeDeleted, which i am then adding into the visibility definition of the button.

The problem is that it seems that the button will only show if ALL the rows have the visibility set for it, if one of them does not, then the button does not show.

Please see DataTables definition below:

var dataTable = _$affiliateGroupsTable.DataTable({
            paging: true,
            serverSide: true,
            processing: true,
            listAction: {
                ajaxFunction: _affiliateGroupsService.getAll,
            },
            columnDefs: [
                {
                    targets: 0,
                    data: "affiliateGroup.name"
                },
                {
                    targets: 1,
                    data: "affiliateGroup.id",
                    render(data, type, row, meta) {
                        return "http://" + window.location.hostname + "/?a=" + row.affiliateGroup.id;
                    }
                },
                {
                    width: 120,
                    targets: 2,
                    data: null,
                    orderable: false,
                    autoWidth: false,
                    defaultContent: '',
                    rowAction: {
                        cssClass: 'btn btn-brand dropdown-toggle',
                        text: '<i class="fa fa-cog"></i> ' + app.localize('Actions') + ' <span class="caret"></span>',
                        items: [
                            {
                                text: app.localize('Edit'),
                                visible: function (data) {
                                    debugger;
                                    return _permissions.edit && data.record.affiliateGroup.canBeEdited;
                                },
                                action: function (data) {
                                    _createOrEditModal.open({ id: data.record.affiliateGroup.id });
                                }
                            },
                            {
                                text: app.localize('Delete'),
                                visible: function (data) {
                                    return _permissions.delete && data.record.affiliateGroup.canBeDeleted;
                                },
                                action: function (data) {
                                    deleteAffiliateGroup(data.record.affiliateGroup);
                                }
                            },
                            {
                                text: app.localize('Configure Payouts'),
                                visible: function (data) {
                                    return _permissions.configurePayouts && data.record.affiliateGroup.canBeEdited;
                                },
                                action: function (data) {
                                    window.location.href =
                                        'AffiliateGroupItems/?group=' + data.record.affiliateGroup.id;
                                }
                            }
                        ]
                    }
                },
            ]
        });

Hi,

In our application, we are checking some bits that require a database lookup (duplicates etc) during the method call to the Add/Update method on the AppServices. What i am looking to do is throw a detailed validation exception if something is incorrect.

I have found this link:

<a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Validating-Data-Transfer-Objects">https://aspnetboilerplate.com/Pages/Doc ... er-Objects</a>

but it is not clear how i can get hold of the validation context from an appservice.

Please advise.

Hi,

I need to know how i can combine two data properties into a single column.

For example, the following JSON:

{"CurrencyName":"USD", "Amount":12.95}

I would like to render a single column in my table that has:

CurrencyName Amount

I presume that I need to use the render function, but have no idea how to reference the two different data elements.

Any ideas?

Hi,

Thanks for the quick response!

You were right, there was an entry in there referencing 3.6.1. I have deleted it and all is well.

Thanks, would never have thought to check there!

Hi,

Thanks for the reply. Seems they have managed to break it.

I am having issues on 3.5 however. i am getting the following exception when loading any page as a tenant:

System.IO.FileLoadException: 'Could not load file or assembly 'Abp, Version=3.6.1.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

I have verified that, 3.6.1 is not referenced on any of my projects, and even cleared the nuget cache to be 100% sure.

here is the full stack trace:

at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName) at Abp.Notifications.TenantNotificationInfoExtensions.ToTenantNotification(TenantNotificationInfo tenantNotificationInfo) in D:\Github\aspnetboilerplate\src\Abp\Notifications\TenantNotificationInfoExtensions.cs:line 18 at Abp.Notifications.UserNotificationInfoWithNotificationInfoExtensions.ToUserNotification(UserNotificationInfoWithNotificationInfo userNotificationInfoWithNotificationInfo) in D:\Github\aspnetboilerplate\src\Abp\Notifications\UserNotificationInfoWithNotificationInfoExtensions.cs:line 13 at System.Linq.Enumerable.SelectListIterator2.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Abp.Notifications.UserNotificationManager.<GetUserNotificationsAsync>d__2.MoveNext() in D:\Github\aspnetboilerplate\src\Abp\Notifications\UserNotificationManager.cs:line 27 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Inovine.Gsoc.Portal.Notifications.NotificationAppService.

Pretty frustrating as an entire day has been wasted trying to figure out what someone else has messed up... guess my fault for updating the packages.....

Any ideas on this?

I am getting a few exceptions however on the notifications service that is trying to reference 3.6.1 can you please advise what version of ASP.NET Zero is compatible with v 3.5.0 of ABP?

So, after a few hours of digging, i can confirm that this is a bug that has been introduced in:

<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3254">https://github.com/aspnetboilerplate/as ... ssues/3254</a>

After rolling back to v3.5 everything is working as expected.

I am aware that out of the box, the package has not been configured to use a tenant name that is actually a full URL, but that is the requirement of our client.

Can we get this changed and the bug fixed or failing that. Please advise how we can reference our own tenant resolver to handle this ourselves.

Thanks,

Question

Hi,

I am having some issues with this. What confuses me is that this has worked previously, so not sure if a recent Nuget update has broken it or not.

I have two tenants configured, the default one, and one named xxx.yyy.io

Beta.gsoc.io resolves to 127.0.0.1 in the development hostfile.

The issue is that when browsing to xxx.yyy.io I end up on the host tenant. I have tried clearing cookies etc, and no luck.

Here are the key bits of code:

public override void PreInitialize()
        {
            Configuration.MultiTenancy.IsEnabled = true;
            Configuration.Modules.AbpWebCommon().MultiTenancy.DomainFormat = "{0}";
 
            Configuration.Modules.AspNetZero().LicenseCode = _appConfiguration["AbpZeroLicenseCode"];
            Configuration.Navigation.Providers.Add<DashboardNavigationProvider>();
        }

Appsettings.json

"App": {
    "WebSiteRootAddress": "http://{TENANCY_NAME}:5000/",
    "RedirectAllowedExternalWebSites": "http://localhost:45776/"
  },

Any idea why this is no longer resolving?

Showing 11 to 18 of 18 entries