Jqxgrid _settings not defined


#1

Hello all friends and colleagues of mine.
I’m back to an app I developed on NSB 4. Now I’m on 6.0.3, since version 7 gave me lot of errors. The relevant app works fine once deployed on a Server2008R2 , but I changed my development OS to Win10Pro and I’d to reinstall NsbAppStudio. Now when I try to launch my app locally it raises an error, say “grAnag_settings is not defined”, where grAnag is the name of a jqWidget grid. Please note that I have copied all jqWidgets code in the source directory of my project, and it’s displayed correctly at design time.
Have you any clue? Can you point me to the righe direction? Thanks in advance.

Saverio


#2

If you open the Chrome console, you can see where this message is occurring in your code.

Could you be executing this statement before the grAbag Grid is instantiated?


#3

Thank you for you ready reply. However, I’m not able to get your point. This app is normally running if launched from my runtime web site. I face this issue only in this development environment (Win10Pro, NSB 6.0.3). That said, how can I perform something in code before a control is instantiated? Here is my code (pls note that the error is thrown at the very first line of code in Function Form3_onshow():

in form0 (acting normally)
============================================start of relevant code in form0

Function btnFind_onclick()
      btnCambiaResp.disabled=True
      ChangeForm(Form3)
End Function

============================================end of relevant code in form0
in form3 (raising immediately the error for which I made this post)
============================================start of relevant code in form3

Dim _datiAnag,codVescovo,codParroco

Function Form3_onshow()
  grAnag_settings.columns = [ _
      { text: "Id", dataField: "CodAnagrafica", width: 0 }, _
      { text: "Descrizione", dataField: "Descrizione", width: 220 }, _
      { text: "Telefono", dataField: "Telefono", width: 110 }, _
      { text: "Mobile", dataField: "Mobile", width: 110 }, _
      { text: "Mail", dataField: "Mail", width: 110 }, _
      { text: "Dioc.", dataField: "CodDiocesi", width: 60 }, _
      { text: "Parr.", dataField: "CodParrocchia", width: 60 }, _
      { text: "Com.", dataField: "CodComunita", width: 60 }, _
      { text: "Eq.", dataField: "CodEquipe", width: 60 }, _
    ]
    $("#grAnag").jqxGrid(grAnag_settings);
    $("#grAnag .jqx-widget-content").css("font-size","14px");
End Function

============================================end of relevant code in form3


#4

Are there any other errors in the Chrome Console?


#5

Yes, An error showing a failled load for an image. Goin’ investigating


#6

actually, there’s an error stating it can’t find an image. However, I tried different locations and nothing works. Wher is it supposed to be to this statement to work?

cx=PictureBox5.getContext("2d")
cx.addImage("SigilloCammino.jpg")

#7

the previous question remains (where should I put images to be loaded?). However, I commented the line which tried (unsuccesfully) to load the image, and the “load” error isn’t thrown any more, and still remains the error quoted in the title of this post.


#8

I think I’ve found your problem. Each new release of AppStudio has a section called ‘Breaking Changes’. These are changes we had to make to AppStudio which may cause problems in your code.

Here are the Version 5 breaking changes. See #8. (you may want to review the others as well):
https://wiki.nsbasic.com/Version_5#Breaking_Changes

The reason for this change is that all the settings for the jqWidgets controls are now in the NSB object. Before, we were creating a top level object for each jqWidgets control, polluting to the main namespace unnecessarily.

You might want to check for Version 6 and Version 7 breaking changes as well.


#9

Thank you so much, George.

I’ve fully overlooked breaking changes in Version 5, since I jumped from version 4 to 6 directly.

Have a nice day!

Saverio Tedeschi