Starts in:
1 DAY
5 HRS
28 MIN
5 SEC
Starts in:
1 D
5 H
28 M
5 S

Activities of "ElifKaya"

hi

_yourModal.onOpen(function () { 
    _yourModal.getForm().abpAjaxForm({ 
        error: function (jqXhr) { 
            var error = jqXhr.responseJSON.error; 
 
            return false; 
        } 
    }); 
}) 

thank you :)

hi

What's content of your modal.js?

I used modal submit form, then I throw Business Exception with object parameter from backend. Then I need to get this error data object(data-requestId). I can see this data in console log, but I can not reach detail of error data in modal.js file.

Can you give an example please

hi

You can use SmtpEmailSender like:

context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, SmtpEmailSender>());

But why we need to replace again, because I used NullEmailSender only if DEBUG tag.

Thanks :)

How to trigger Copy Log button click for this solution, can you give an example? Because, it can not be triggered.

I think you can do this in your globally used script file by using the id you gave to the button.

Note: If you don't have a global js file, you can do it similarly to the global.css' config.

$( "#DownloadLog" ).click(function() { 
  alert( "Handler for .click() called." ); 
}); 

Actually, we tried like this but it doesn't work

Can you provide to open modal even if exception in OnGetAsync?

ABP uses abp.message.error to show errors and sweetalert2 is used in its infrastructure. So I think you can do this with Sweatalert2's configurations. For example:

$(function () { 
    abp.libs.sweetAlert.config.error.footer = "<button type='button' id='Copy Log' class='swal2-cancel swal2-styled'>Download Log</button>" 
    abp.libs.sweetAlert.config.error.didOpen = () => { 
        var errorDetails = Swal.getHtmlContainer(); 
        console.log(errorDetails); 
    } 
}); 

Note: As far as I know, sweetalert2 allows you to change the entire error(or other default templates) template as well.

Result:

Note: If you want to see the detail and stack trace of the error in modal like me, you can do this as in the code below:

Configure< AbpExceptionHandlingOptions >(options => 
{ 
    options.SendExceptionsDetailsToClients = true; 
    options.SendStackTraceToClients = true; 
}); 

For more information:

  1. https://docs.abp.io/en/abp/latest/UI/AspNetCore/JavaScript-API/Message#sweetalert-configuration
  2. https://sweetalert2.github.io/

How to trigger Copy Log button click for this solution, can you give an example? Because, it can not be triggered.

$(function () { abp.libs.sweetAlert.config.error.footer = "<button type='button' id='Copy Log' class='swal2-cancel swal2-styled'>Download Log</button>" abp.libs.sweetAlert.config.error.didOpen = () => { var errorDetails = Swal.getHtmlContainer(); console.log(errorDetails); } });

hi

It is not recommended that you inject services inside the ConfigureServices method. The dependency injection container has not been created yet.

I need to check tenant db connectionSetting before configuring menu contributor.

You can inject the services in menu contributor.

public class AbpAccountUserMenuContributor : IMenuContributor 
{ 
    public virtual Task ConfigureMenuAsync(MenuConfigurationContext context) 
    { 
      var tenantRepository = context.ServiceProvider.GetRequiredService<ITenantRepository>(); 
 
        return Task.CompletedTask; 
    } 
} 
 

I tried this solution first, but I get an error like this. What would be the reason?

And the above example is taken from our own module, but I want to use this logic also in Volo.CmsKit MenuContributor. How should I override it in CmsKit MenuContributor.

hi

You can remove the CmsKit MenuContributor from the AbpNavigationOptions and copy the code to your MenuContributor

Configure<AbpNavigationOptions>(options => 
{ 
    options.MenuContributors.Remove... 
}); 

Thanks for your advice but I don't want to manage with options. I need to override CmsKitAdminMenuContributor.cs on some special case. Is there any way to do this?

Showing 31 to 40 of 57 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06