Wisej.Web.Ext.DevExtreme.dxDataGrid licalization error

0
0

Wisej.Web.Ext.DevExtreme.dxDataGrid licalization error

Hi,

Something went wrong…

I tried:

Application.Eval(“DevExpress.localization.locale(‘de’);”)

Application.Eval(“DevExpress.localization.locale(‘de’)”)

But I received an error message: DevExpress is not defined. What is wrong.

Please find image attached.

Attachment
  • You must to post comments
0
0

Hi again!

According to DevEx, (in order DXdatagrid to be localizable in run time) I have to execute: Me.Eval(DevExpress.localization.locale(‘de’); ”) BEFORE DXDataGrid being initialized.

I can’t do so as I receive DevExpress is not defined error.

I can’t refer all.js library of DevEx in main.html page, as it going in conflict with all.js in your Wisej.Web.Ext.DevExtreme.dll.

I can’t remove all.js from your Wisej.Web.Ext.DevExtreme.dll as everything  stops to work.

I added the code in  InitScript but nothing happens. No error message, no German language interface.

.InitScript = “DevExpress.localization.loadMessages(‘de’); DevExpress.localization.locale(‘de’);”

I also did:  Application.Eval(“DevExpress.localization.loadMessages(‘de’); document.body.lang=’de’;”) – nothing happens.

How can I execute Me.Eval(DevExpress.localization.locale(‘de’); ”) from your Wisej.Web.Ext.DevExtreme.dll BEFORE DXDataGrid being initialized, is the main question?

Thank you!

  • You must to post comments
0
0

Resources in an assembly are not loaded automatically by the browser. They are just resources in an assembly.

Additionally, a bug in the C# compiler fails to include any embedded resource that ends with “.aa” when the 2 letter code is a recognized language. The compiler simply silently ignores the embedded resource without even logging it. I had to rename the embedded resources to _de, _it, etc. but it didn’t make it to Github, or I was overwritten… I have updated it again. Download it and recompile it from Github: https://github.com/iceteagroup/Wisej-Ext-DevExtreme

Third, we don’t download all the languages all the times. You have to set the language using Application.CurrentCulture in main or at any  point before loading the first devex widget:

Application.CurrentCulture = CultureInfo.GetCultureInfo(“de”)

I have tried it with “it” and “de” and it works well. If it still gives you troubles attach a small runnable test case.

  • mgmst
    • mgmst
    • May 12, 2021 - 6:38 pm
    I have to support several Cultures: en, de, bg, ru and so on. How I can load all of them from the Wisej.Web.Ext.DevExtreme.dll simultaneously?
  • Luca (ITG)
    Simultaneously using devexpress? I don’t think it’s possible. You can switch the culture again using Application.CurrentCulture. If you want a browser to load all the js files at once add them to Default.html and deploy the localization files.
  • mgmst
    • mgmst
    • May 12, 2021 - 7:22 pm
    Thank you! But this scenario makes localization js files in the Wisej.Web.Ext.DevExtreme.dll useless.
  • Luca (ITG)
    I think this is getting very confusing. Best thing is to attach a small simple test case that shows what it is that doesn’t work for you. If devexpress supports localizing the same text with multiple languages then load the files as I have suggested. If you want to remove them from the extension dll, you can and then recompile. If you want to load all of them from the dll you can too, just look at the code and copy/paste it. If you want to to deploy the files you can as well, just copy them.
  • You must to post comments
0
0

Hi again,

From DevExtreeme the say “this file (dx.messages.de.js)  is not loaded on the client side”

How this is possible as  dx.messages.de.js is included in Wisej.Web.Ext.DevExtreme.dll exactly as all.dll and all.dll is loaded.

 

Here is what they say:

Thank you for the clarification, Mariyan. I tested .dll you attached and see that this dictionary exists in Wisej.Web.Ext.DevExtreme However, then this file is not loaded on the client side:
I used DevExSample_dxGrid_exportToPDF for testing. As a result, no localization is applied. Please make sure that “dx.messages.de.js” is loaded to the client side part of your application as well.

  • You must to post comments
0
0

I am calling this (after button “Export to PDF is clicked”):

Public Function FExportToPF() As Boolean

Me.Eval(”
window.jsPDF = window.jspdf.jsPDF;
applyPlugin(window.jsPDF);

const doc = new jsPDF();
DevExpress.pdfExporter.exportDataGrid({
jsPDFDocument: doc,
component: dataGrid
}).then(function() {
doc.save(‘Customers.pdf’);
});

“)
Return True
End Function

 

And it returns: Cannost read property ‘exportDataGrid’ of undefined

  • Luca (ITG)
    Check with devtools. In case add debugger; in the code above and check the context “this”. Try window.DevExpress, etc. This is a javascript issue.
  • mgmst
    • mgmst
    • May 3, 2021 - 7:04 pm
    Thank you! I will play with that.
  • You must to post comments
0
0

I don’t know what you are calling. I tried with the tests and it works. It’s not possible that it’s not defined if the widget loaded.

Attachment
  • You must to post comments
0
0

“If you want to use the DevExpress namespace you have to wait for it to load. ”

I have export to PDF button for the DXGrid widget. Which button I may click long after the widget is loaded and initialized. But still DevExpress namespace do not works in PDF export JS. It says DevExpress not defined.

  • You must to post comments
0
0

If you add the library to the Default.html you have to remove it from the widget packages. Cannot load the same js twice. And if you do it directly (by adding to Default.html) as you would do using devexpress directly then you have to load all the nevessary css, js (including the localization js).

If you download the code from https://github.com/iceteagroup/Wisej-Ext-DevExtreme you will get the built-in localization support and there is no need to load the library again. Just set Application.CultureInfo =  (the culture you want to use). Or set the culture in default.json, or keep it set to “auto” to use the browser culture.

If you want to use the DevExpress namespace you have to wait for it to load. You get the Load event in the Widget class. However, changing the locale won’t change anything unless you reload/rebuild the widget. This is how all third part widgets work,  they can’t update dynamically like wisej widgets do.

Is the issue that you want to use 2 cultures at the same time?

  • mgmst
    • mgmst
    • May 3, 2021 - 6:37 pm
    “Is the issue that you want to use 2 cultures at the same time?” – Yes exactly. I want user to be able to change several cultures in runtime with a click of a button (language flag icon button). I am ready to reload/rebuild all widgets under that procedure.
  • Luca (ITG)
    What I meant is if you want to use one culture for the application, i.e. “en-US” and a different culture only for devexpress i..e. “it-IT”. Otherwise just change Application.CurrentCulture and reload (dexexpress needs the reload).
  • mgmst
    • mgmst
    • May 3, 2021 - 6:45 pm
    Thank you! I want to use same culture for all UI in the project. I still can’t make DevExpress namespace to work ;(
  • mgmst
    • mgmst
    • May 3, 2021 - 6:49 pm
    I do not need Application.CurrentCulture because I have my own localization model for the wisej UI components. I just need to change DevExpress DXGrid localization culture. Also I do not thing you have Bulgarian-BG as culture variant.
  • You must to post comments
0
0
Hi again,
I added dx.all.js like this: (please see the code below)

But I received an error like this:

Uncaught Error: E0024 – DevExtreme bundle already included. See:
It seems that added dx.all.js is in the conflict with the same library in the integration module Wisej.Web.Ext.DevExtreme.dll.
I really need to solve this conflict. Without “DevExpress” name space I can do with the grid almost nothing.
Thank you!
I added dx.all.js like this:
<!DOCTYPE html>
<html>
<head>
<title>MyProject</title>
<meta charset=”utf-8″ />
<meta http-equiv=”X-UA-Compatible” content=”IE=Edge;IE=11″ /><script type=”text/javascript” src=”/Resources/js/DevExpress/Basics/dx.all.js”></script>
<script src=”wisej.wx”></script>

</head>
<body>

</body>
</html>

But I received an error like this:

Uncaught Error: E0024 – DevExtreme bundle already included. See:
http://js.devexpress.com/error/19_2/E0024
at c (dx.all.js?v=637554897221964840:20)
at Object.Error (dx.all.js?v=637554897221964840:20)
at Object.<anonymous> (dx.all.js?v=637554897221964840:21)
at t (dx.all.js?v=637554897221964840:9)
at Object.<anonymous> (dx.all.js?v=637554897221964840:25)
at t (dx.all.js?v=637554897221964840:9)
at Object.<anonymous> (dx.all.js?v=637554897221964840:77)
at t (dx.all.js?v=637554897221964840:9)
at Object.<anonymous> (dx.all.js?v=637554897221964840:129)
at t (dx.all.js?v=637554897221964840:9)
  • You must to post comments
0
0

I downloaded last version from github (DevExtreme-21_1) but I cant find  DevExpress library.

Which  library is DevExpress library?

Thank you!

  • You must to post comments
0
0

The DevExpress library has to be loaded. The browser my take a while to load it. Wisej cannot change the way browsers work. You can add the devexpress libraries to the Default.html page in script tags (these are the only scripts the browser loads synchronously) or add the to call to the DevExpress wrapped widget InitScript, or use the latest library in Github, see source code, it sets the language using the document.body.lang attribute.

  • You must to post comments
Showing 10 results
Your Answer

Please first to submit.