Hello,
we created a context menu in a subfile grid. When the user right clicks on a row, the context menu appears. Now we have the problem to recognize on which row the user has clicked. Our idea is to create an java script which sets a variable to the number of the actual row: changeElementValue("sflrow",row); This java script hangs at the "onrowclick"-property of the grid. Is this the only way to do this? Our problem is that we "loose" the left-click event. We would like to give the user the option to left click on a row (this event shall show details) or to right-click on a row (this event shall show the context menu).
Is there a way to to this?
Dieter
creating a context menu in a grid
-
- Experienced User
- Posts: 122
- Joined: Tue May 22, 2012 6:45 am
- First Name: Dieter
- Last Name: Schröder
- Company Name: Ecclesia Holding GmbH
- State / Province: Outside Canada/USA
- Country: Germany
- Contact:
-
- Profound User
- Posts: 82
- Joined: Fri Jun 29, 2012 2:33 pm
- First Name: Antonio
- Last Name: Ruballos
- Company Name: Profound Logic
- Contact:
Re: creating a context menu in a grid
Hello,
You can bind the "menu response" for the context menu to an RPG variable, and you can bind the "cursor record number" property for the subfile grid as well to RPG variable as well. This should give you all the information you are seeking. Let me know if you have any more questions or issues.
Thanks!
You can bind the "menu response" for the context menu to an RPG variable, and you can bind the "cursor record number" property for the subfile grid as well to RPG variable as well. This should give you all the information you are seeking. Let me know if you have any more questions or issues.
Thanks!
-
- Experienced User
- Posts: 122
- Joined: Tue May 22, 2012 6:45 am
- First Name: Dieter
- Last Name: Schröder
- Company Name: Ecclesia Holding GmbH
- State / Province: Outside Canada/USA
- Country: Germany
- Contact:
Re: creating a context menu in a grid
Many thanks for your answer. It works fine. But i still have two questions: When a subfile row is clicked, there is no automatic round trip to the server. I solved this problem by setting a "pui.click()" on the "onrowclick" event. Is this the correct method to do this? My other question is the following: In our subfile we show insurance contracts. A customer e.g. has a contract for a car insurance and a contract for a house insurance. Depending on what kind of contract is clicked we wish to fill the context menue. Is there a (simple) way to do this?
Please excuse my bad english. I am from Germany.
Dieter
Please excuse my bad english. I am from Germany.
Dieter
-
- Profound User
- Posts: 82
- Joined: Fri Jun 29, 2012 2:33 pm
- First Name: Antonio
- Last Name: Ruballos
- Company Name: Profound Logic
- Contact:
Re: creating a context menu in a grid
Hello,
The pui.click is the correct way to make a round trip to the server. For your second question, you can use the applyProperty in the onrowclick event.
Example:
applyProperty("Menu1", "choices", "one,two,three");
applyProperty("Menu1", "choice values", "1,2,3");
Thanks!
The pui.click is the correct way to make a round trip to the server. For your second question, you can use the applyProperty in the onrowclick event.
Example:
applyProperty("Menu1", "choices", "one,two,three");
applyProperty("Menu1", "choice values", "1,2,3");
Thanks!
Who is online
Users browsing this forum: No registered users and 10 guests