Jump to content

The issue with locking TUniDBGrid columns in runtime when the end user using browser zoom.


JamesP

Recommended Posts

Hello,

I hope you can help me out to resolve the issue with locking TUniDBGrid columns in runtime when the end user using browser zoom.

When the end user uses Google Chrome zoom 100%, 150%, 75%, 80%, 90% the program works fine, but if user set another zoom like: 110%, 125%, 67% and etc.. The program blows up without showing any error in the debug mode it's just screen stalls and you have to restart it. It could be replicated if you run in the debug mode (stand alone) or if the program is deployed on IIS server.

I have developed the complex PLM system and noticed that issue when system was developed using FMSoft_uniGUI_Complete_Professional_1.90.0.1560.exe version.

That time it worked fine on browser zoom: 100%, 75%, 125%, 150%.

I implemented the function that catch the user browser zoom and if the zoom is a list (100%, 75%, 125%, 150%)  the system locks the columns, but if other zoom is used, the system doesn't lock the columns. That solution wasn't ideal, but it was difficult to create the test case as the system is complicated and the functionality is loaded based on a lot of parameters and conditions, so that time I did not reported this issue to you.

Recently, our customers reported that the system stopped working on zoom 125% as well (system was developed using software FMSoft_uniGUI_Complete_Professional_1.90.0.1565.exe that time).

I have installed the latest version FMSoft_uniGUI_Complete_Professional_1.95.0.1575.exe, but the issue still exists. We can't keep saying to the customers that now is the other valid zoom list. We really need the issue to be resolved.

I have created the test case based on FMSoft_uniGUI_Complete_Professional_1.95.0.1575.exe software (the latest one).

Brief explanation how to replicate the issue:

1. Build and run the ZoomError.dpr:

image.thumb.png.642556818f10323645fbd103f8b49913.png

  1. Then, please click on "Create Frame and Load Grid" button. If you select a Google Chrome zoom 100%, 150%, 75%, 80%, 90% It will create a frame without any issue, please see screen below.

The grid will have locked "PRODUCTCODE" and "DESCRIPTION" columns. I have implemented two methods to lock columns:

2.1 when "Lock columns using JS" checkbox is unchecked, it uses code inside procedure TUpdateGridFrame.BuildDBGrid;

……

        if not FLockcolumnsUsingJS then

        begin

          ColumnDB.Locked := True;

        end;

…….

2.2  when "Lock columns using JS" checkbox is checked, it uses code:

procedure TUpdateGridFrame.DoLockProductDescription;

var

  grid: TUniDBGrid;

begin

  grid := UniDBGridUpdateGrid;

  with grid do

  begin

    Columns[0].Locked := True;

    Columns[1].Locked := True;

    TExUniCustomDBGrid(grid).DoConfigureJSColumns(grid.DataSource.DataSet);

    grid.JSInterface.JSCall('view.refresh', []);

  end;

end;

image.thumb.png.0c41f4d8d4dc1397ff484c295403ad40.png

Those data will be loaded from Data folder, file MemTBValues_zoom.json:

image.png.aa5eda57c1f7fbfe8dcd7d6ffc336a19.png

 

 

  1. Those two methods fail when browser zoom is not in this list: 100%, 150%, 75%, 80%, 90%

image.thumb.png.fed9bf53a48a8a65cf4d5136de1166c6.png

Here is testcase: ZoomError.zip

We really need your help to sort it out. Thank you in advance.

Kind Regards.

ZoomError.zip

Link to comment
Share on other sites

3 hours ago, Sherzod said:

Hello,

Have you tried testing it on other browsers?

Hi Sherzod,
 

We tested this issue on all browsers: Chrome, Edge and Firefox, Safari (Mac). I can confirm that there is the same issue on all browsers.

Kind Regards.

Link to comment
Share on other sites

4 minutes ago, Sherzod said:

Hello @JamesP

Can you also check this behavior using standard demo examples?

Hi Sherzod,

Could you please clarify which demo example you are talking about? As if you have got TUniDBGrid with columns created in the design time it will work on any zoom.

The problem comes when columns are created in the runtime and you try to lock columns. Also, it does work when zoom is 100%, 150%, 75%, 90%, 80%, but it doesn't work if 110%, 120%, 125% and etc... The issue appears on all browser and there is no AJAX error popup or Delphi error.

The testcase I have sent to you is as much as possible simplified version of the functionality I have got in the our system, where fields and columns are created in the runtime based on very complicated rules.  I have taken out all "IF" and all condition based on which columns are created, but it still has the same issue.

Before to approach to you I did research on all similar topics you have got on uniGUI forums.

Kind Regards.

Link to comment
Share on other sites

3 hours ago, Sherzod said:

Hello,

Sorry, once again please tell me the main goal, what is the logic of your module, how do you want to use the grid?

Hello,

I have got the PLM system that is SPA. There is a main form that has TUniPageControl with many TUniTabSheet(s). Something like that:

image.thumb.png.da0e6496d72eb20b5bfdef1fc00a1875.png

The system load categories, then user selects category (on screen "SOLD PRODUCTS") then it loads predefined filters for this category. When user select filter it loads products that match to filter criteria. The system allows maintaining the products, amend, delete, create them. All product details divided by Tabs with a lot of different types of attributes: Text, Numbers, Dates. Memo, Grids and etc... All screens dynamically created in the run time based on configuration in the SQL DB.

User can amend product data by loading individual product, or user can amend many products by selecting filter and click "Update Grid" button.

The system enable "Update Grid" Tab (you can see it in the Main TUniPageControl, TabSheet: "Update Grid") and then create a Frame "TUpdateGridFrame" from unit uUpdateGridFrame.pas. Then, based on Category, Filter, Product Tab selected, it will generate SQL based on required category attributes grab the data from DB, then generate Grid columns that belongs only selected Product Tab, locks first two columns "Product Code" and "Product Description". All fields and Grid Columns are created in the runtime based on selected conditions.

Now about the testcase (ZoomError):

I have simplified the project completely. I have taken almost everything out, create a main form with TUniPageControl and one TUniTabSheet (that is like "Update Grid"). put one button "Create Frame and Load Grid". When you click on that button it create a frame TUpdateGridFrame, load data from JSON file which I grabbed from real module where MemTable is generated in the runtime, but I saved it in the JSON file. You can find procedure TUpdateGridFrame.BuildDBGrid; where it creates 6 columns (hard coded in the test case, but in the PLM system those columns created in the loops with conditions), so it's real data and real columns settings, but hard coded for the testcase.

To recap: the testcase shows that if you create columns in the runtime and lock columns and user browser has a zoom not listed in this list (100%, 150%, 75%, 80%, 90%), just try on 110%, 125% the system freeze with dark screen as I showed in the initial post. 

I hope it makes sense.

Kind Regards.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Hi Sherzod,

Could you please provide any update on this. 

I have provided a testcase that it's easy to replicate the issue, but it's already passed two months since the then.

There is the support ticket FSD-4992

Thank you in advance.

Kind Regards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...