Is there a way we can manage a grid in javascript?
There are 2 things i would like to achieve.
First: load the grid with data already loaded in local storage.
Second: allow to select a record from a grid and transfer it to another grid. Kind of like the drag and drop, but using the click way instead of dragging.
In both cases i would like the rpg program to see the data of those grids on the return to server.
I am pretty sure this is something achievable, as profound must have internal functions to do that. I just don't know how we can access those functions.
Thanks
manage grid in javascript
-
- Profound User
- Posts: 41
- Joined: Fri Aug 16, 2013 7:23 am
- First Name: Sebastien
- Last Name: Gagne
- Company Name: Oceanex
- Contact:
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: manage grid in javascript
Hi Sebastien,
Happy new year!
Unfortunately, we don't currently have a great way to set the values of widgets in a subfile from JavaScript. We have a getDataValue() method that you can use to retrieve the values, but we do not have a corresponding setDataValue() method, which sounds like what you need.
You could write blank records from your RPG program, and update them using the changeElementValue (or pui.set, which is an alias for changeElementValue) but unfortunately this will only work for grid elements that have already been put on the screen. Those that are on pages that haven't been displayed cannot be updated this way, which is why I think you'd want/need a setDataValue() method.
The way Profound UI loads the grid from the RPG program is very different, as in that case, all of the data is already known and loaded into arrays before the grid is drawn on the screen. So we don't have a routine (even internally) that would work for you at this point.
Also keep in mind that part of the work is done by the handler. So in order for your data to be returned back to the RPG program, it would have to be in records that the Handler knows about -- i.e., data that was originally written from the RPG program. So you could write blank records from the RPG progam, and if the fields are bi-directional (like text boxes) you could update them from JavaScript and return them, but you would not be able to add new records this way (at least, not unless we changed some of the code) and you would not be able to update and return data in output-only fields.
So, unfortunately, we don't have something like this yet... we'd need to add a new feature.
As for selecting a record and adding it to another grid... this could be done by using the "row selection" feature to let you select the rows, and then you could submit this back to the RPG program, which could find the selected rows and add them to another grid. So this could work, but for now anyway, you'd need to submit things back to the RPG program.
I could create a feature request for you, but, probably the best way to submit a feature request is just to e-mail support@profoundlogic.com
Happy new year!
Unfortunately, we don't currently have a great way to set the values of widgets in a subfile from JavaScript. We have a getDataValue() method that you can use to retrieve the values, but we do not have a corresponding setDataValue() method, which sounds like what you need.
You could write blank records from your RPG program, and update them using the changeElementValue (or pui.set, which is an alias for changeElementValue) but unfortunately this will only work for grid elements that have already been put on the screen. Those that are on pages that haven't been displayed cannot be updated this way, which is why I think you'd want/need a setDataValue() method.
The way Profound UI loads the grid from the RPG program is very different, as in that case, all of the data is already known and loaded into arrays before the grid is drawn on the screen. So we don't have a routine (even internally) that would work for you at this point.
Also keep in mind that part of the work is done by the handler. So in order for your data to be returned back to the RPG program, it would have to be in records that the Handler knows about -- i.e., data that was originally written from the RPG program. So you could write blank records from the RPG progam, and if the fields are bi-directional (like text boxes) you could update them from JavaScript and return them, but you would not be able to add new records this way (at least, not unless we changed some of the code) and you would not be able to update and return data in output-only fields.
So, unfortunately, we don't have something like this yet... we'd need to add a new feature.
As for selecting a record and adding it to another grid... this could be done by using the "row selection" feature to let you select the rows, and then you could submit this back to the RPG program, which could find the selected rows and add them to another grid. So this could work, but for now anyway, you'd need to submit things back to the RPG program.
I could create a feature request for you, but, probably the best way to submit a feature request is just to e-mail support@profoundlogic.com
Who is online
Users browsing this forum: No registered users and 0 guests