All Answers

0 votes

Hi Laszlo,

please contact us directly with your license information at salesATwisej.com

Best regards
Frank

0 votes

OKKKK Solved
this.getHtml = function(){
return this.getContentElement().getDomElement().outerHTML;
}

“this.” is needed before function name

ciao
Cristian

0 votes

Hi Luca,
ok now it works, I have understand, but don’t return all the html, only this:
{“$$element”:”60-0″,”$$widget”:”59-0″,”$$hash”:”145-0″,”$$displayed”:true}

istead if I use iniScript still error ‘Unknown function: getHtml’

what am I doing wrong?
ciao
Cristian

0 votes

Thanks for reporting!

The issue has been logged as #1972

It will be fixed in the next development build.  I’ll let you know when it’s available!

Best,

Levie

0 votes

The code snippet in my reply was to be added to a .js file included in Default.html (like in a plain ASP.NET or HTML app). In that case the functions are all globals: window.getHtml.

If you use the JavaScript extender in Wisej 1.5 or the InitiScript property in Wisej 2.0 (you can still use the JavaScript extender with 2.0 but it has the InitScript property as well), then the script runs in the widget’s context so the code should be:

function getHtml()
{
return this.getContentElement().getDomElement().outerHTML;
}

Dim html As String = Await Me.CallAsync("getHtml")

 

  • Luca answered Sep 18, 2019 - 1:20 pm
0 votes

Hi Luca
thank you! I need a little help because I never use javascript extender.
I have add Jascript1 from the tools, I have select my control and copy in Javscript property the code
function getHtml(widget)
{
var dom = widget.getContentElement().getDomElement();
}

from my application I use
Dim html As String = Await Application.CallAsync("window.getHtml", Me)
but visual studio say ‘Unknown function: window.getHtml’

0 votes

The ImageSource reads any URL (it’s the src attribute of the img tag or the url in a css sheet). Can be a URL to an external image or to an image deployed on your server.

If the image is not available to the web server then it cannot be downloaded by the browser. Wisej allow the easy use of embedded resources as images using the resource.wx handler. See the section Embedded Resource URL: https://wisej.com/docs/2.0/html/EmbeddedResources.htm

  • Luca answered Sep 18, 2019 - 11:49 am
0 votes

The autocomplete list is entirely handled by the browser’s native <input> tag: https://www.w3schools.com/tags/tag_datalist.asp

It doesn’t have any css property that can be used to change its appearance.

  • Luca answered Sep 18, 2019 - 11:44 am
0 votes

Glenn,

I checked your code. What data is intended to be loaded into the grid ?
This line in your Init function does not make sense to me, so I uncommented it:

// spread.fromJSON(dataSource);

The grid then opens empty, you can type in some value and to export them,
simply change your exportpdf function (see at the end of this message).

Here you can simple reuse the reference this._spread that you are setting in the Init function.
Hope that gets you started into the right direction and helps you to figure out the other functionality.

Best regards
Frank

.fctbNone{ color:#000000; }
.fctbStyle0{ color:#2e75b6; }
.fctbStyle1{ color:#a31515; }
 this._spread.savePDF(
            function (blob) {
                console.log(blob);
                saveAs(blob, 'download.pdf');
            },
            console.log,
            {
                title: 'Test Title',
                author: 'Test Author',
                subject: 'Test Subject',
                keywords: 'Test Keywords',
                creator: 'test Creator'
            });

0 votes

Hi Cristian,

Sounds great! You don’t need to use the callback WebMethod to get data back from a JavaScrip call. You can receive the return value like this:

this.Eval("this.getContentElement().getDomElement().outerHTML, (html) => { AlertBox.Show(html); });

In fact the best approach would be to add a JavaScript function (add a .js file to Default.html) that can do everything you need in one call (get the css, etc.), the call:

Application.Call("window.getHtml", (html) => { AlertBox.Show(html); }, this);

or

string html = await Application.CallAsync("window.getHtml", this);

The js function can be:

function getHtml(widget)
{
  var dom = widget.getContentElement().getDomElement();
...
}

To extract the CSS you have several ways, it’s all javascript. The empty <style> you see are dynamic stylesheets. You can get them using https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/styleSheets

Then for each stylesheet you can get the rules.

HTH

 

 

  • Luca answered Sep 18, 2019 - 11:08 am
0 votes

Yes, I have checked that, and I was able to run the grid, but only got the problem when I want to export, or print, or even convert to JSON. There was an error during load, which I already attached, and I also attached the sample project.

0 votes

ah but no problem if instead backgroundsourceimage I use ImageSource
but for example the css style qx-textlabel-borderSolid where is it???

0 votes

update: the inline css are in the header… but there is samething of strange.
see the image, the CSS that have the BackgroundImageSource are empty, but if I delete it, the image disappear

0 votes
In reply to: MenuItem class

Hi Dmitry,

can you please provide the full test code ?
Either post it here or send it to frankATiceteagroup.com

What´s the button name and image property containing ?
What font are you using ?
What Wisej version are you using ?

Thanks in advance.

Best regards
Frank

  • Frank (ITG) answered Sep 17, 2019 - 10:41 am
  • last active Sep 17, 2019 - 10:44 am
0 votes

Hi Glenn,

did you check these samples ?

https://wisej.com/support/question/wisej-integrated-with-componentone-spreadjs

https://wisej.com/support/question/integration-js-widget-how-to-get-values-from-widget

They should help you to find out how to use the SpreadJS component in Wisej.

Best regards
Frank

0 votes

Any suggestion for get CSS? because it is not inline in the body using document.body.innerHTML
if I get the CSS I’m ok

0 votes

Hi Luca,
I have solved by myself 😉
I read all the html of the usercontrol

Protected Overrides Sub OnWebRender( ByVal config As Object)
MyBase.OnWebRender(CObj(config))
config.webMethods = {"test"}
End Sub

Public Sub test(testo As String)
IO.File.WriteAllText("f:\temp\aaaaaaaaaaa.html", testo)
End Sub

and with this I call the function
Eval("this.test(document.getElementById('id_" & Me.Handle.ToString & "').outerHTML)")
then I save the html to a file… now I can edit it, transform to doc, pdf …
ciao
Cristian

0 votes

Wisej pages are all standard HTML + CSS. The problem is to bundle HTML, CSS and images together. IE can export to an MHT file. I believe Chrome has an extension that can do that. In javascript you can get the HTML using document.body.innerHTML, then you’d have to extract the CSS, download images, etc. Not easy, that’s probably why I found many similar questions around and not a single tool that does it.

We also have the Html2Canvas extension here https://github.com/iceteagroup/wisej-extensions It can take a screenshot of the Wisej page and send it to the app as an image.

  • Luca answered Sep 16, 2019 - 9:35 pm
0 votes

Browsers don’t let  you do that. You can set the body css zoom but it’s very different from the browser’s zoom. You can also look at the viewport metatag, but it works only on mobile.

  • Luca answered Sep 16, 2019 - 12:35 am
0 votes

Hi,

Any update on this?

 

Thanks.

Showing 5521 - 5540 of 11k results