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.
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!
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.
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.
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
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.
“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.
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?
But I received an error like this:
</head>
<body>
</body>
</html>
But I received an error like this:
I downloaded last version from github (DevExtreme-21_1) but I cant find DevExpress library.
Which library is DevExpress library?
Thank you!
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.
Please login first to submit.