KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Solutions DataGrid displaying previous query results with latest query results

  • DataGrid displaying previous query results with latest query results

    Posted by jlucid on July 24, 2023 at 12:00 am

    I have a data grid which returns the results of queries to different tables, the tables have different schemas.

    When I run the query against table 1 the results are returned correctly, if I run against table 2 the results are returned correctly, but if I then go back to querying table 1 then both the results for table 2 (the previous query) and table 1 are shown on screen.

    I confirmed that the gateway is returning just the results for table 1.

    Because the data grid column names change, depending on the table being queried, the columns tab has just 1 entry, column1 where Data Field Name is set to * and Display Name is set to *. I also have “Keep NonExistent Columns” set to false.

     

    Anyone know how to fix this issue?

    jlucid replied 9 months, 2 weeks ago 2 Members · 2 Replies
  • 2 Replies
  • kieran

    Member
    July 25, 2023 at 12:00 am

    Hey,

    It seems like you are using the correct properties here, I have attached a working demo  below just to confirm the database properties. (just change the dropdown selection to change the database columns)

     

    In terms of potential issues, a first port of call is to check the console to see if there are any errors being returned by the queries that may potentially cause an issue.  To open up console press control + shift+i

     

     

  • jlucid

    Member
    July 26, 2023 at 12:00 am

    Thanks Kieran, I compared my settings with yours and they are identical to so that was good to verify. You’re dashboard worked as expected in my browser. I tried to modify your data source in various ways to repo the error but with no success. I tried adding common columns to both tables, changing the table lengths, adding some character columns etc but I couldnt break it.

    I also checked for browser errors on my dashboard but nothing is standing out.

    When the issue appears, if I go to edit mode and execute the query (so input arguments are the same) the results returned are as expected, I press apply and the old records vanish.  So I am happy the query itself is returning the expected values. Its a very odd one.

    I can only conclude that there must be a browser error somewhere that’s making the difference on my side.  I will probably try to rebuild the dashboard at some point to see if that fixes it.

    For now, I have decided to change around my dashboard so that the different tables are viewed in separate data grids, and this may actually be more user friendly also, as it allows users to view both tables at the same time.  Thanks again for the help

     

Log in to reply.